Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fb532ff
Try to add an app console and reproduce the error; Uncaught NotSuppor…
jlewi-openai Dec 21, 2025
e5a5bd5
Make custom element registration idempotent
jlewi-openai Dec 21, 2025
708d055
Guard console messaging when context is missing
jlewi-openai Dec 21, 2025
e20aa2f
Declare renderers as peer dependency for react-console
jlewi-openai Dec 21, 2025
144dfe7
Externalize runme libs and declare as peers
jlewi-openai Dec 21, 2025
79b7638
Tweak AppConsole welcome message
jlewi-openai Dec 21, 2025
4a54e27
Add stub prompt/echo behavior to AppConsole
jlewi-openai Dec 21, 2025
89380fe
Buffer AppConsole input and add welcome banner
jlewi-openai Dec 21, 2025
09643bb
Allow per-instance console context and wire RunmeConsole
jlewi-openai Dec 21, 2025
2a70530
Let each RunmeConsole use its own messaging context
jlewi-openai Dec 21, 2025
dc802e9
Add a commit message.
jlewi-openai Dec 21, 2025
cbe57d6
Remove defineCustomElement wrapper and restore decorators
jlewi-openai Dec 21, 2025
10be0d3
Remove unused getContext.
Dec 21, 2025
8fc23f5
Allow RunmeConsole to accept injected messaging context
Dec 21, 2025
b90a22f
Extract RunmeRenderContext and allow injected contexts
Dec 21, 2025
41dcc92
Start building a testApp.
Dec 21, 2025
7cdf28c
Revert RunmeRenderContext helper and inline context bridge
Dec 22, 2025
0de0fcd
Remove import of getContext.
Dec 22, 2025
7a1c3ab
Add testApp consoles using AppConsole stub
Dec 22, 2025
1730926
Expose Streams types and add StreamCreator hooks for testing
Dec 22, 2025
70890f7
Change definition of streams type to streamslike.
Dec 22, 2025
2896c59
Wire testApp consoles to FakeStreams via StreamCreator
Dec 22, 2025
bf7890c
Log which Streams factory RunmeConsole uses
Dec 22, 2025
7fa7d8b
Clean up testApp
Dec 22, 2025
e7a5be0
Add some debug logging; revert this later.
Dec 22, 2025
bbd816a
Export FakeStreams and use package fake in testApp
Dec 22, 2025
205b226
Add some more logging; testApp seems to be working but you need to re…
Dec 22, 2025
e87c99b
Add a README.
Dec 22, 2025
044f92f
Remove AppConsole from react-components.
Dec 22, 2025
fad5fc4
Fix the lock file.
Dec 22, 2025
1baf0b8
Changelog for jlewi dev release.
Dec 30, 2025
20ecf08
Revert most changes to the bare minimum to get this to work for myself.
Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/react-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @runmedev/react-components

## 3.16.5-jlewi.0

### Patch Changes

- Test the changes to support renderers and react-console being imported

## 3.16.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runmedev/react-components",
"version": "3.16.4",
"version": "3.16.5-jlewi.0",
"license": "Apache-2.0",
"type": "module",
"private": false,
Expand Down
8 changes: 8 additions & 0 deletions packages/react-console/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @runmedev/react-console

## 3.16.5-jlewi.0

### Patch Changes

- Test the changes to support renderers and react-console being imported
- Updated dependencies
- @runmedev/[email protected]

## 3.16.4

### Patch Changes
Expand Down
5 changes: 3 additions & 2 deletions packages/react-console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runmedev/react-console",
"version": "3.16.4",
"version": "3.16.5-jlewi.0",
"license": "Apache-2.0",
"type": "module",
"private": false,
Expand All @@ -22,6 +22,7 @@
"@runmedev/renderers": "workspace:*"
},
"peerDependencies": {
"@runmedev/renderers": "workspace:*",
"@bufbuild/protobuf": "^2.9.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand All @@ -41,4 +42,4 @@
"publishConfig": {
"access": "public"
}
}
}
6 changes: 6 additions & 0 deletions packages/renderers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @runmedev/renderers

## 3.16.5-jlewi.0

### Patch Changes

- Test the changes to support renderers and react-console being imported

## 3.16.4

### Patch Changes
Expand Down
7 changes: 6 additions & 1 deletion packages/renderers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runmedev/renderers",
"version": "3.16.4",
"version": "3.16.5-jlewi.0",
"license": "Apache-2.0",
"type": "module",
"private": false,
Expand All @@ -17,6 +17,11 @@
"types": "./dist/components.d.ts",
"import": "./dist/components.mjs",
"require": "./dist/components.cjs"
},
"./streams/fakeStreams": {
"types": "./dist/streams/fakeStreams.d.ts",
"import": "./dist/streams/fakeStreams.mjs",
"require": "./dist/streams/fakeStreams.cjs"
}
},
"files": [
Expand Down
43 changes: 28 additions & 15 deletions packages/renderers/src/components/console/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {
import { Disposable, TerminalDimensions } from 'vscode'

import { FitAddon, type ITerminalDimensions } from '../../fitAddon'
import { getContext, onClientMessage, postClientMessage } from '../../messaging'
import {
getContext,
onClientMessage,
postClientMessage,
} from '../../messaging'
import { ClientMessages, OutputType, WebViews } from '../../types'
import { ClientMessage } from '../../types'
import { closeOutput } from '../../utils'
Expand All @@ -28,6 +32,7 @@ import './open'
import './saveButton'
import './shareButton'
import { darkStyles, lightStyles } from './vscode.css'
import type { RendererContext } from 'vscode-notebook-renderer'

export interface ConsoleViewConfig {
theme: 'dark' | 'light' | 'vscode'
Expand Down Expand Up @@ -427,6 +432,14 @@ export class ConsoleView extends LitElement {
@property({ type: Boolean })
isDaggerOutput: boolean = false

// Optional per-instance messaging context; falls back to module-level context.
@property({ attribute: false })
context?: RendererContext<void>

#ctx(): RendererContext<void> {
return this.context ?? getContext()
}

protected applyThemeStyles(): void {
if (!this.shadowRoot) {
return
Expand Down Expand Up @@ -525,7 +538,7 @@ export class ConsoleView extends LitElement {
this.terminal.unicode.activeVersion = '11'
this.terminal.options.drawBoldTextInBrightColors

const ctx = getContext()
const ctx = this.#ctx()

this.disposables.push(
// todo(sebastian): what's the type of e?
Expand Down Expand Up @@ -726,7 +739,7 @@ export class ConsoleView extends LitElement {
this.#subscribeSetTerminalRows(dims)
terminalContainer.appendChild(resizeDragHandle)

const ctx = getContext()
const ctx = this.#ctx()
ctx.postMessage &&
postClientMessage(ctx, ClientMessages.terminalOpen, {
'runme.dev/id': this.id!,
Expand Down Expand Up @@ -905,7 +918,7 @@ export class ConsoleView extends LitElement {
)

const sub = debounced$.subscribe(async (terminalDimensions) => {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand All @@ -930,7 +943,7 @@ export class ConsoleView extends LitElement {
)

const sub = debounced$.subscribe(async (terminalRows) => {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand Down Expand Up @@ -963,7 +976,7 @@ export class ConsoleView extends LitElement {
this.terminal?.focus()
}

const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand All @@ -974,7 +987,7 @@ export class ConsoleView extends LitElement {
}

async #displayShareDialog(): Promise<boolean | void> {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage || !this.shareUrl) {
return
}
Expand All @@ -993,7 +1006,7 @@ export class ConsoleView extends LitElement {
}

async #triggerEscalation(): Promise<boolean | void | undefined> {
// const ctx = getContext()
// const ctx = this.#ctx()
this.isCreatingEscalation = true

// try {
Expand All @@ -1016,7 +1029,7 @@ export class ConsoleView extends LitElement {
}

async #triggerOpenEscalation(): Promise<boolean | void | undefined> {
const ctx = getContext()
const ctx = this.#ctx()

if (!this.escalationUrl) {
return
Expand All @@ -1026,7 +1039,7 @@ export class ConsoleView extends LitElement {
}

#openSessionOutput(): Promise<void | boolean> | undefined {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand All @@ -1042,7 +1055,7 @@ export class ConsoleView extends LitElement {
async #shareCellOutput(
_isUserAction: boolean
): Promise<boolean | void | undefined> {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand Down Expand Up @@ -1084,17 +1097,17 @@ export class ConsoleView extends LitElement {
}

#onWebLinkClick(_event: MouseEvent, uri: string): void {
postClientMessage(getContext(), ClientMessages.openLink, uri)
postClientMessage(this.#ctx(), ClientMessages.openLink, uri)
}

#triggerOpenCellOutput(): void {
postClientMessage(getContext(), ClientMessages.openLink, this.shareUrl!)
postClientMessage(this.#ctx(), ClientMessages.openLink, this.shareUrl!)
}

#onEscalateDisabled(): void {
const message =
'There is no Slack integration configured yet. \nOpen Dashboard to configure it'
postClientMessage(getContext(), ClientMessages.errorMessage, message)
postClientMessage(this.#ctx(), ClientMessages.errorMessage, message)
}

// Render the UI as a function of component state
Expand Down Expand Up @@ -1205,7 +1218,7 @@ export class ConsoleView extends LitElement {
}

#copy() {
const ctx = getContext()
const ctx = this.#ctx()
if (!ctx.postMessage) {
return
}
Expand Down
2 changes: 2 additions & 0 deletions packages/vite.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export function createSharedConfig({ entry, name, fileName }) {
rollupOptions: {
external: [
'@buf/googleapis_googleapis.bufbuild_es',
'@runmedev/renderers',
'@runmedev/react-console',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think it'll work to externalize these. The webapp just imports @runmedev/react-components and you shouldn't have to provide these separately. Is this strictly necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right. I can try reverting this.
Since I'm just importing react-console we can probably revert all the peer dependency changes.

'react',
'react-dom',
'react/jsx-runtime',
Expand Down
Loading