@tt-a1i/openpi 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -40
- package/SETUP.md +22 -6
- package/assets/openpi-launch-card-v1.webp +0 -0
- package/bin/openpi.js +145 -0
- package/extensions/background-terminals/index.ts +30 -2
- package/extensions/background-terminals/src/domain.ts +2 -0
- package/extensions/background-terminals/src/manager.ts +486 -106
- package/extensions/background-terminals/src/output.ts +33 -0
- package/extensions/background-terminals/src/prompt.ts +13 -5
- package/extensions/background-terminals/src/result-delivery.ts +4 -1
- package/extensions/clear-context/index.ts +83 -0
- package/extensions/context-pivot/index.ts +16 -6
- package/extensions/cron/schedule.ts +7 -1
- package/extensions/file-mutation-display/render.ts +17 -257
- package/extensions/file-search/src/binaries.ts +57 -41
- package/extensions/git-read/index.ts +1 -3
- package/extensions/model-info/index.ts +21 -33
- package/extensions/model-info/session-metrics.ts +96 -0
- package/extensions/plan-mode/bash-policy.ts +54 -9
- package/extensions/plan-mode/index.ts +7 -2
- package/extensions/post-edit/index.ts +16 -6
- package/extensions/sessions/git-stats.ts +258 -72
- package/extensions/sessions/index.ts +153 -86
- package/extensions/sessions/preview-cache.ts +104 -0
- package/extensions/sessions/preview-loader.ts +856 -0
- package/extensions/sessions/sessions.ts +43 -4
- package/extensions/setup/index.ts +123 -127
- package/extensions/shared/activity-status.ts +30 -0
- package/extensions/shared/agent-session-page.ts +319 -0
- package/extensions/shared/agent-tool-renderer.ts +218 -0
- package/extensions/shared/agent-transcript.ts +524 -0
- package/extensions/shared/capability-intent.ts +1 -1
- package/extensions/shared/child-session.ts +437 -21
- package/extensions/shared/result-delivery.ts +34 -0
- package/extensions/shared/setup-config.ts +73 -33
- package/extensions/shared/setup-episode-state.ts +1 -1
- package/extensions/shared/terminal-text.ts +110 -23
- package/extensions/shared/text-projection.ts +72 -15
- package/extensions/shared/tool-activity.ts +382 -0
- package/extensions/shared/tool-surface.ts +29 -2
- package/extensions/shared/transcript-viewport.ts +46 -0
- package/extensions/shared/web-observer-registry.ts +390 -0
- package/extensions/shared/worktree.ts +11 -0
- package/extensions/subagents/index.ts +270 -59
- package/extensions/subagents/navigation.ts +34 -5
- package/extensions/subagents/src/backend.ts +12 -1
- package/extensions/subagents/src/backends/pi.ts +375 -66
- package/extensions/subagents/src/domain.ts +5 -0
- package/extensions/subagents/src/manager.ts +34 -2
- package/extensions/subagents/src/prompt.ts +32 -4
- package/extensions/subagents/src/result-artifact.ts +4 -0
- package/extensions/subagents/src/result-delivery.ts +7 -1
- package/extensions/subagents/src/runtime.ts +15 -1
- package/extensions/subagents/src/ui/takeover.ts +73 -257
- package/extensions/subagents/src/ui/transcript.ts +38 -535
- package/extensions/subagents/src/ui/wait-result.ts +103 -15
- package/extensions/suggestions/src/ui.ts +10 -4
- package/extensions/tasks/index.ts +0 -3
- package/extensions/ui-customization/footer.ts +0 -40
- package/extensions/ui-customization/index.ts +0 -4
- package/extensions/user-input-fold/index.ts +1 -1
- package/extensions/web/index.ts +234 -0
- package/extensions/workflows/artifacts.ts +137 -47
- package/extensions/workflows/completion-projection.ts +457 -0
- package/extensions/workflows/coordinator.ts +8 -10
- package/extensions/workflows/dashboard.ts +167 -228
- package/extensions/workflows/handoff.ts +70 -16
- package/extensions/workflows/index.ts +488 -198
- package/extensions/workflows/journal.ts +148 -13
- package/extensions/workflows/model.ts +74 -4
- package/extensions/workflows/navigation.ts +32 -8
- package/extensions/workflows/progress-projection.ts +306 -0
- package/extensions/workflows/prompt.ts +66 -6
- package/extensions/workflows/replay-safety.ts +42 -21
- package/extensions/workflows/result-delivery.ts +128 -64
- package/extensions/workflows/retention.ts +593 -0
- package/extensions/workflows/runner.ts +388 -279
- package/extensions/workflows/sandbox-child.cjs +25 -3
- package/extensions/workflows/sandbox.ts +62 -8
- package/extensions/workflows/serialization.ts +325 -17
- package/extensions/workflows/tool-renderer.ts +22 -0
- package/extensions/workflows/transcript.ts +149 -0
- package/extensions/workspace-cleanup-guard/index.ts +54 -0
- package/extensions/workspace-cleanup-guard/workspace-provenance.ts +563 -0
- package/package.json +28 -8
- package/skills/subagents/REFERENCE.md +189 -0
- package/skills/subagents/SKILL.md +1 -1
- package/skills/workflows/REFERENCE.md +4 -2
- package/web/adapter/pi-adapter.ts +661 -0
- package/web/host/browser-launcher.ts +20 -0
- package/web/host/static-assets.ts +4 -0
- package/web/host/terminal-status.ts +38 -0
- package/web/host/web-host.ts +789 -0
- package/web/http-dispatcher.ts +125 -0
- package/web/protocol/types.ts +462 -0
- package/web/runtime/pi-runtime.ts +991 -0
- package/web/runtime/types.ts +71 -0
- package/web/runtime/web-host-lease.ts +497 -0
- package/web/trace.ts +18 -0
- package/web/ui/app.js +1398 -0
- package/web/ui/index.html +139 -0
- package/web/ui/styles.css +598 -0
- package/web/vite.config.mjs +34 -0
- package/extensions/execution-convergence/active-evidence.ts +0 -129
- package/extensions/execution-convergence/index.ts +0 -442
- package/extensions/execution-convergence/workspace-provenance.ts +0 -338
- package/extensions/setup/intercom-fs-helper.cjs +0 -130
- package/extensions/setup/intercom.ts +0 -603
- package/extensions/subagents/src/backends/stub.ts +0 -303
|
@@ -32,6 +32,10 @@ import {
|
|
|
32
32
|
OPENPI_TOOL_SURFACE,
|
|
33
33
|
patchOwnedTools,
|
|
34
34
|
} from "../shared/tool-surface.ts";
|
|
35
|
+
import {
|
|
36
|
+
projectBackgroundTerminalCapability,
|
|
37
|
+
registerWebCapability,
|
|
38
|
+
} from "../shared/web-observer-registry.ts";
|
|
35
39
|
import type { TerminalSnapshot } from "./src/domain.ts";
|
|
36
40
|
import {
|
|
37
41
|
MAX_RUNNING,
|
|
@@ -95,6 +99,8 @@ interface WatchToolDetails {
|
|
|
95
99
|
export default function (pi: ExtensionAPI) {
|
|
96
100
|
let runtime: TerminalRuntime | undefined;
|
|
97
101
|
let managerPromise: Promise<TerminalManagerShape> | undefined;
|
|
102
|
+
let managerForHooks: TerminalManagerShape | undefined;
|
|
103
|
+
let unregisterWebCapability: (() => void) | undefined;
|
|
98
104
|
let sessionContext: ExtensionContext | undefined;
|
|
99
105
|
let ui: ExtensionUIContext | undefined;
|
|
100
106
|
let unsubStatus: (() => void) | undefined;
|
|
@@ -115,9 +121,21 @@ export default function (pi: ExtensionAPI) {
|
|
|
115
121
|
|
|
116
122
|
/** Resolve the manager service once per runtime and wire the extension hooks. */
|
|
117
123
|
const getManager = () => {
|
|
124
|
+
const scope = sessionContext?.sessionManager;
|
|
118
125
|
managerPromise ??= getRuntime()
|
|
119
126
|
.runPromise(TerminalManager)
|
|
120
127
|
.then((manager) => {
|
|
128
|
+
managerForHooks = manager;
|
|
129
|
+
unregisterWebCapability?.();
|
|
130
|
+
unregisterWebCapability =
|
|
131
|
+
scope && sessionContext?.sessionManager === scope
|
|
132
|
+
? registerWebCapability(scope, {
|
|
133
|
+
kind: "background-terminals",
|
|
134
|
+
snapshot: () =>
|
|
135
|
+
projectBackgroundTerminalCapability(manager.view.list()),
|
|
136
|
+
subscribe: (listener) => manager.view.subscribe(listener),
|
|
137
|
+
})
|
|
138
|
+
: undefined;
|
|
121
139
|
manager.view.setOnSettled(onSettled);
|
|
122
140
|
unsubStatus?.();
|
|
123
141
|
unsubStatus = manager.view.subscribe(() => updateWidget(manager));
|
|
@@ -214,6 +232,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
214
232
|
// costing a turn.
|
|
215
233
|
resultDeliveryOptions(wake),
|
|
216
234
|
);
|
|
235
|
+
for (const snap of snaps) managerForHooks?.view.releaseResult(snap.id);
|
|
217
236
|
return true;
|
|
218
237
|
} catch (error) {
|
|
219
238
|
// Session may be shutting down, but retain the snapshot so any later
|
|
@@ -253,6 +272,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
253
272
|
stdout: { ...snap.stdout },
|
|
254
273
|
stderr: { ...snap.stderr },
|
|
255
274
|
});
|
|
275
|
+
managerForHooks?.view.retainResult(snap.id);
|
|
256
276
|
// Pending settlements remain retractable while busy, so bg_status/bg_kill
|
|
257
277
|
// can consume them before they are committed to context. bg_start applies
|
|
258
278
|
// backpressure across running + pending + reserved work, keeping this map
|
|
@@ -310,7 +330,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
310
330
|
ui = undefined;
|
|
311
331
|
const closing = runtime;
|
|
312
332
|
runtime = undefined;
|
|
333
|
+
unregisterWebCapability?.();
|
|
334
|
+
unregisterWebCapability = undefined;
|
|
313
335
|
managerPromise = undefined;
|
|
336
|
+
managerForHooks = undefined;
|
|
314
337
|
await closing?.dispose();
|
|
315
338
|
});
|
|
316
339
|
|
|
@@ -423,12 +446,16 @@ export default function (pi: ExtensionAPI) {
|
|
|
423
446
|
);
|
|
424
447
|
}
|
|
425
448
|
|
|
449
|
+
const text = buildStatusResult(snap);
|
|
426
450
|
// This status is returning the settlement itself; a pending automatic
|
|
427
451
|
// follow-up for the same settle would be a duplicate.
|
|
428
|
-
if (snap.status !== "running")
|
|
452
|
+
if (snap.status !== "running") {
|
|
453
|
+
resultDelivery.consume([snap.id]);
|
|
454
|
+
manager.view.releaseResult(snap.id);
|
|
455
|
+
}
|
|
429
456
|
|
|
430
457
|
return {
|
|
431
|
-
content: [{ type: "text", text
|
|
458
|
+
content: [{ type: "text", text }],
|
|
432
459
|
details: {
|
|
433
460
|
id: snap.id,
|
|
434
461
|
status: snap.status,
|
|
@@ -510,6 +537,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
510
537
|
// via the killInterest consumed flag). Remove any deferred automatic
|
|
511
538
|
// delivery now that this tool returns the final state itself.
|
|
512
539
|
resultDelivery.consume(ids);
|
|
540
|
+
for (const id of ids) manager.view.releaseResult(id);
|
|
513
541
|
|
|
514
542
|
return {
|
|
515
543
|
content: [{ type: "text", text: buildKillReport(report) }],
|
|
@@ -23,6 +23,8 @@ export type TerminalStatus =
|
|
|
23
23
|
export interface OutputView {
|
|
24
24
|
/** Decoded, possibly head-trimmed text (bounded by the in-memory cap). */
|
|
25
25
|
readonly text: string;
|
|
26
|
+
/** Stateful, bounded projection safe for model-facing output. */
|
|
27
|
+
readonly modelSafeText: string;
|
|
26
28
|
/** True total bytes ever received on this stream. */
|
|
27
29
|
readonly totalBytes: number;
|
|
28
30
|
/** Bytes dropped from the head of the in-memory view (0 = complete). */
|