@vendoai/vendo 0.4.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/LICENSE +202 -0
- package/README.md +28 -0
- package/bin/vendo.mjs +4 -0
- package/dist/ai-sdk.d.ts +35 -0
- package/dist/ai-sdk.js +62 -0
- package/dist/auth-presets/auth-js.d.ts +14 -0
- package/dist/auth-presets/auth-js.js +91 -0
- package/dist/auth-presets/auth0.d.ts +23 -0
- package/dist/auth-presets/auth0.js +98 -0
- package/dist/auth-presets/clerk.d.ts +23 -0
- package/dist/auth-presets/clerk.js +65 -0
- package/dist/auth-presets/conformance.d.ts +42 -0
- package/dist/auth-presets/conformance.js +139 -0
- package/dist/auth-presets/identity.d.ts +56 -0
- package/dist/auth-presets/identity.js +152 -0
- package/dist/auth-presets/index.d.ts +14 -0
- package/dist/auth-presets/index.js +12 -0
- package/dist/auth-presets/jwt.d.ts +16 -0
- package/dist/auth-presets/jwt.js +54 -0
- package/dist/auth-presets/shared.d.ts +35 -0
- package/dist/auth-presets/shared.js +1 -0
- package/dist/auth-presets/supabase.d.ts +42 -0
- package/dist/auth-presets/supabase.js +229 -0
- package/dist/byo-approvals.d.ts +37 -0
- package/dist/byo-approvals.js +189 -0
- package/dist/capability-misses.d.ts +38 -0
- package/dist/capability-misses.js +172 -0
- package/dist/catalog.d.ts +19 -0
- package/dist/catalog.js +152 -0
- package/dist/cli/cloud/args.d.ts +3 -0
- package/dist/cli/cloud/args.js +32 -0
- package/dist/cli/cloud/auth.d.ts +17 -0
- package/dist/cli/cloud/auth.js +123 -0
- package/dist/cli/cloud/client.d.ts +28 -0
- package/dist/cli/cloud/client.js +133 -0
- package/dist/cli/cloud/command.d.ts +22 -0
- package/dist/cli/cloud/command.js +73 -0
- package/dist/cli/cloud/deploy.d.ts +26 -0
- package/dist/cli/cloud/deploy.js +187 -0
- package/dist/cli/cloud/device-login.d.ts +32 -0
- package/dist/cli/cloud/device-login.js +259 -0
- package/dist/cli/cloud/index.d.ts +5 -0
- package/dist/cli/cloud/index.js +59 -0
- package/dist/cli/cloud/keys.d.ts +2 -0
- package/dist/cli/cloud/keys.js +31 -0
- package/dist/cli/cloud/members.d.ts +3 -0
- package/dist/cli/cloud/members.js +25 -0
- package/dist/cli/cloud/output.d.ts +4 -0
- package/dist/cli/cloud/output.js +12 -0
- package/dist/cli/cloud/pending-claim.d.ts +29 -0
- package/dist/cli/cloud/pending-claim.js +38 -0
- package/dist/cli/cloud/read.d.ts +3 -0
- package/dist/cli/cloud/read.js +12 -0
- package/dist/cli/cloud/services.d.ts +2 -0
- package/dist/cli/cloud/services.js +9 -0
- package/dist/cli/cloud/session.d.ts +13 -0
- package/dist/cli/cloud/session.js +41 -0
- package/dist/cli/cloud-init.d.ts +60 -0
- package/dist/cli/cloud-init.js +149 -0
- package/dist/cli/dep-versions.d.ts +26 -0
- package/dist/cli/dep-versions.js +77 -0
- package/dist/cli/doctor-codes.d.ts +58 -0
- package/dist/cli/doctor-codes.js +60 -0
- package/dist/cli/doctor-live.d.ts +67 -0
- package/dist/cli/doctor-live.js +169 -0
- package/dist/cli/doctor.d.ts +52 -0
- package/dist/cli/doctor.js +467 -0
- package/dist/cli/eject.d.ts +29 -0
- package/dist/cli/eject.js +141 -0
- package/dist/cli/extract/apply.d.ts +26 -0
- package/dist/cli/extract/apply.js +123 -0
- package/dist/cli/extract/claude-cli-harness.d.ts +18 -0
- package/dist/cli/extract/claude-cli-harness.js +132 -0
- package/dist/cli/extract/claude-harness.d.ts +14 -0
- package/dist/cli/extract/claude-harness.js +127 -0
- package/dist/cli/extract/codex-cli-harness.d.ts +31 -0
- package/dist/cli/extract/codex-cli-harness.js +154 -0
- package/dist/cli/extract/delegate.d.ts +21 -0
- package/dist/cli/extract/delegate.js +77 -0
- package/dist/cli/extract/extraction.d.ts +65 -0
- package/dist/cli/extract/extraction.js +300 -0
- package/dist/cli/extract/gateway-fuel.d.ts +69 -0
- package/dist/cli/extract/gateway-fuel.js +69 -0
- package/dist/cli/extract/harness.d.ts +114 -0
- package/dist/cli/extract/harness.js +84 -0
- package/dist/cli/extract/index.d.ts +9 -0
- package/dist/cli/extract/index.js +9 -0
- package/dist/cli/extract/npx-engine-harness.d.ts +73 -0
- package/dist/cli/extract/npx-engine-harness.js +225 -0
- package/dist/cli/extract/stages.d.ts +149 -0
- package/dist/cli/extract/stages.js +398 -0
- package/dist/cli/framework.d.ts +8 -0
- package/dist/cli/framework.js +36 -0
- package/dist/cli/init-auth.d.ts +67 -0
- package/dist/cli/init-auth.js +142 -0
- package/dist/cli/init-scaffolds.d.ts +28 -0
- package/dist/cli/init-scaffolds.js +235 -0
- package/dist/cli/init.d.ts +115 -0
- package/dist/cli/init.js +1008 -0
- package/dist/cli/mcp/index.d.ts +7 -0
- package/dist/cli/mcp/index.js +59 -0
- package/dist/cli/mcp/registry.d.ts +9 -0
- package/dist/cli/mcp/registry.js +117 -0
- package/dist/cli/mcp/server-json.d.ts +12 -0
- package/dist/cli/mcp/server-json.js +65 -0
- package/dist/cli/mcp/server.schema.json +574 -0
- package/dist/cli/mcp/verify-domain.d.ts +11 -0
- package/dist/cli/mcp/verify-domain.js +48 -0
- package/dist/cli/playground/app/embed-entry.d.ts +20 -0
- package/dist/cli/playground/app/embed-entry.js +46 -0
- package/dist/cli/playground/app/fake-client.d.ts +3 -0
- package/dist/cli/playground/app/fake-client.js +215 -0
- package/dist/cli/playground/app/fixtures.d.ts +47 -0
- package/dist/cli/playground/app/fixtures.js +472 -0
- package/dist/cli/playground/app/main.d.ts +1 -0
- package/dist/cli/playground/app/main.js +108 -0
- package/dist/cli/playground/app/scenario-mount.d.ts +13 -0
- package/dist/cli/playground/app/scenario-mount.js +48 -0
- package/dist/cli/playground/app/scenarios.d.ts +25 -0
- package/dist/cli/playground/app/scenarios.js +152 -0
- package/dist/cli/playground/app/theme-editor.d.ts +13 -0
- package/dist/cli/playground/app/theme-editor.js +149 -0
- package/dist/cli/playground/app/theme-state.d.ts +29 -0
- package/dist/cli/playground/app/theme-state.js +151 -0
- package/dist/cli/playground/bundle.gen.d.ts +2 -0
- package/dist/cli/playground/bundle.gen.js +2 -0
- package/dist/cli/playground/embed-bundle.gen.d.ts +2 -0
- package/dist/cli/playground/embed-bundle.gen.js +2 -0
- package/dist/cli/playground.d.ts +33 -0
- package/dist/cli/playground.js +120 -0
- package/dist/cli/pretty.d.ts +48 -0
- package/dist/cli/pretty.js +330 -0
- package/dist/cli/refine.d.ts +43 -0
- package/dist/cli/refine.js +181 -0
- package/dist/cli/semantics.d.ts +31 -0
- package/dist/cli/semantics.js +122 -0
- package/dist/cli/shared.d.ts +68 -0
- package/dist/cli/shared.js +184 -0
- package/dist/cli/sync.d.ts +36 -0
- package/dist/cli/sync.js +202 -0
- package/dist/cli/theme/color.d.ts +15 -0
- package/dist/cli/theme/color.js +188 -0
- package/dist/cli/theme/css-vars.d.ts +13 -0
- package/dist/cli/theme/css-vars.js +40 -0
- package/dist/cli/theme/entry-candidates.d.ts +5 -0
- package/dist/cli/theme/entry-candidates.js +22 -0
- package/dist/cli/theme/extract-theme.d.ts +184 -0
- package/dist/cli/theme/extract-theme.js +358 -0
- package/dist/cli/theme/walk.d.ts +2 -0
- package/dist/cli/theme/walk.js +24 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +333 -0
- package/dist/cloud-apps.d.ts +17 -0
- package/dist/cloud-apps.js +46 -0
- package/dist/cloud-console.d.ts +32 -0
- package/dist/cloud-console.js +72 -0
- package/dist/cloud-tools.d.ts +23 -0
- package/dist/cloud-tools.js +196 -0
- package/dist/connections.d.ts +71 -0
- package/dist/connections.js +192 -0
- package/dist/deployment-identity.d.ts +12 -0
- package/dist/deployment-identity.js +69 -0
- package/dist/dev-creds/model.d.ts +65 -0
- package/dist/dev-creds/model.js +159 -0
- package/dist/dev-creds/resolve.d.ts +36 -0
- package/dist/dev-creds/resolve.js +57 -0
- package/dist/hosted-store.d.ts +52 -0
- package/dist/hosted-store.js +322 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1 -0
- package/dist/mastra.d.ts +46 -0
- package/dist/mastra.js +88 -0
- package/dist/react.d.ts +10 -0
- package/dist/react.js +32 -0
- package/dist/refine.d.ts +244 -0
- package/dist/refine.js +599 -0
- package/dist/remixable.d.ts +18 -0
- package/dist/remixable.js +42 -0
- package/dist/runtime-capture.d.ts +18 -0
- package/dist/runtime-capture.js +111 -0
- package/dist/sandbox-wire.d.ts +101 -0
- package/dist/sandbox-wire.js +101 -0
- package/dist/sandbox.d.ts +38 -0
- package/dist/sandbox.js +389 -0
- package/dist/server.d.ts +216 -0
- package/dist/server.js +1320 -0
- package/dist/sync-impact.d.ts +14 -0
- package/dist/sync-impact.js +75 -0
- package/dist/turn-liveness.d.ts +33 -0
- package/dist/turn-liveness.js +105 -0
- package/dist/wire/approvals.d.ts +10 -0
- package/dist/wire/approvals.js +59 -0
- package/dist/wire/apps.d.ts +5 -0
- package/dist/wire/apps.js +155 -0
- package/dist/wire/automations.d.ts +5 -0
- package/dist/wire/automations.js +57 -0
- package/dist/wire/box.d.ts +3 -0
- package/dist/wire/box.js +268 -0
- package/dist/wire/connections.d.ts +5 -0
- package/dist/wire/connections.js +47 -0
- package/dist/wire/context.d.ts +22 -0
- package/dist/wire/context.js +190 -0
- package/dist/wire/doctor.d.ts +19 -0
- package/dist/wire/doctor.js +116 -0
- package/dist/wire/misc.d.ts +18 -0
- package/dist/wire/misc.js +227 -0
- package/dist/wire/shared.d.ts +158 -0
- package/dist/wire/shared.js +134 -0
- package/dist/wire/threads.d.ts +3 -0
- package/dist/wire/threads.js +68 -0
- package/package.json +151 -0
- package/skills/vendo-setup/SKILL.md +128 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The docs inline-embed entry (vendo.run/playground/embed.js): mounts REAL
|
|
4
|
+
* chrome surfaces — scripted data, no model key — directly into a host page's
|
|
5
|
+
* DOM (no iframe). Built by scripts/build-playground.mjs into
|
|
6
|
+
* embed-bundle.gen.ts; the CLI playground server and the vendo-web static
|
|
7
|
+
* export both serve it as /embed.js.
|
|
8
|
+
*
|
|
9
|
+
* window.VendoDocsEmbed.mount(el, { scenario: "approval-flow" })
|
|
10
|
+
* window.VendoDocsEmbed.mountLauncher()
|
|
11
|
+
*
|
|
12
|
+
* `mount` returns a dispose function. `mountLauncher` drops the real corner
|
|
13
|
+
* launcher + overlay onto the page (the actual product drop-in) — one call,
|
|
14
|
+
* one line to remove.
|
|
15
|
+
*/
|
|
16
|
+
import { defaultVendoTheme } from "@vendoai/ui";
|
|
17
|
+
import { StrictMode } from "react";
|
|
18
|
+
import { createRoot } from "react-dom/client";
|
|
19
|
+
import { ScenarioMount } from "./scenario-mount.js";
|
|
20
|
+
import { scenarios } from "./scenarios.js";
|
|
21
|
+
import { decodeThemeParam } from "./theme-state.js";
|
|
22
|
+
function mount(el, options) {
|
|
23
|
+
const scenario = scenarios.find((entry) => entry.id === options.scenario);
|
|
24
|
+
if (!scenario) {
|
|
25
|
+
const known = scenarios.map((entry) => entry.id).join(", ");
|
|
26
|
+
throw new Error(`[vendo-embed] unknown scenario "${options.scenario}" — one of: ${known}`);
|
|
27
|
+
}
|
|
28
|
+
const theme = decodeThemeParam(options.theme ?? null) ?? defaultVendoTheme;
|
|
29
|
+
const root = createRoot(el);
|
|
30
|
+
root.render(_jsx(StrictMode, { children: _jsx(ScenarioMount, { scenario: scenario, theme: theme, root: el }) }));
|
|
31
|
+
return () => root.unmount();
|
|
32
|
+
}
|
|
33
|
+
/** The real product drop-in: corner launcher pill + overlay, scripted data. */
|
|
34
|
+
function mountLauncher(options = {}) {
|
|
35
|
+
const host = document.createElement("div");
|
|
36
|
+
host.dataset.vendoDocsLauncher = "";
|
|
37
|
+
document.body.append(host);
|
|
38
|
+
const dispose = mount(host, { scenario: "overlay-launcher", theme: options.theme });
|
|
39
|
+
return () => {
|
|
40
|
+
dispose();
|
|
41
|
+
host.remove();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
window.VendoDocsEmbed = { mount, mountLauncher };
|
|
45
|
+
// Host pages poll for readiness; give them an event too.
|
|
46
|
+
window.dispatchEvent(new Event("vendo-docs-embed-ready"));
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An in-page VendoClient over the static wire payload fixtures — the
|
|
3
|
+
* playground's replacement for the live wire. Reads answer from fixture
|
|
4
|
+
* state; mutations update that state in memory so flows (approve, dismiss,
|
|
5
|
+
* disconnect) behave; streaming never lands here because every scenario mounts
|
|
6
|
+
* the ScriptedTransport at the provider seam.
|
|
7
|
+
*/
|
|
8
|
+
import { VendoError } from "@vendoai/core";
|
|
9
|
+
export function createFakeClient(fixtures) {
|
|
10
|
+
const state = {
|
|
11
|
+
threads: [...fixtures.threads],
|
|
12
|
+
apps: [...fixtures.apps],
|
|
13
|
+
automations: fixtures.automations.map((entry) => ({ ...entry })),
|
|
14
|
+
connections: [...fixtures.connections],
|
|
15
|
+
approvals: [...fixtures.approvals],
|
|
16
|
+
approvalResolutions: new Map(),
|
|
17
|
+
grants: [...fixtures.grants],
|
|
18
|
+
runs: [...fixtures.runs],
|
|
19
|
+
};
|
|
20
|
+
const app = (id) => {
|
|
21
|
+
const found = state.apps.find((candidate) => candidate.id === id);
|
|
22
|
+
if (!found)
|
|
23
|
+
throw new VendoError("not-found", `Unknown app ${id}`);
|
|
24
|
+
return found;
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
baseUrl: "playground:fake",
|
|
28
|
+
headers: {},
|
|
29
|
+
threads: {
|
|
30
|
+
// Streaming rides the scripted transport (the provider override); the
|
|
31
|
+
// playground never opens a live turn stream.
|
|
32
|
+
stream: async () => new Response(null, { status: 501 }),
|
|
33
|
+
list: async () => state.threads.map(({ id, title, updatedAt }) => ({ id, title, updatedAt })),
|
|
34
|
+
get: async (id) => {
|
|
35
|
+
const found = state.threads.find((candidate) => candidate.id === id);
|
|
36
|
+
if (!found)
|
|
37
|
+
throw new VendoError("not-found", `Unknown thread ${id}`);
|
|
38
|
+
return found.thread;
|
|
39
|
+
},
|
|
40
|
+
delete: async (id) => {
|
|
41
|
+
state.threads = state.threads.filter((candidate) => candidate.id !== id);
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
approvals: {
|
|
45
|
+
pending: async () => [...state.approvals],
|
|
46
|
+
decide: async (ids, decision) => {
|
|
47
|
+
const decided = new Set(Array.isArray(ids) ? ids : [ids]);
|
|
48
|
+
state.approvals = state.approvals.filter((approval) => !decided.has(approval.id));
|
|
49
|
+
// Existing-agents — mirror the wire's park→resume so a scenario's
|
|
50
|
+
// <VendoApprovalEmbed> resolves in place after a decision.
|
|
51
|
+
for (const id of decided) {
|
|
52
|
+
state.approvalResolutions.set(id, decision.approve
|
|
53
|
+
? { state: "executed", outcome: { status: "ok", output: { delivered: true } } }
|
|
54
|
+
: { state: "declined" });
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
get: async (id) => {
|
|
58
|
+
const pending = state.approvals.find((approval) => approval.id === id);
|
|
59
|
+
if (pending)
|
|
60
|
+
return { state: "pending", request: pending };
|
|
61
|
+
const resolved = state.approvalResolutions.get(id);
|
|
62
|
+
if (resolved)
|
|
63
|
+
return resolved;
|
|
64
|
+
throw new VendoError("not-found", `Unknown approval ${id}`);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
grants: {
|
|
68
|
+
list: async () => [...state.grants],
|
|
69
|
+
revoke: async (id) => {
|
|
70
|
+
state.grants = state.grants.filter((grant) => grant.id !== id);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
connections: {
|
|
74
|
+
list: async () => [...state.connections],
|
|
75
|
+
// The scripted catalog mirrors the scenarios' explicit connectors prop;
|
|
76
|
+
// surfaces resolving in auto mode see the same two toolkits.
|
|
77
|
+
catalog: async () => [
|
|
78
|
+
{ toolkit: "slack", connector: "composio" },
|
|
79
|
+
{ toolkit: "github", connector: "composio" },
|
|
80
|
+
],
|
|
81
|
+
initiate: async ({ toolkit, connector }) => ({
|
|
82
|
+
id: `conn_${toolkit}_new`,
|
|
83
|
+
connector: connector ?? "composio",
|
|
84
|
+
// A same-page anchor: nothing to OAuth against in the playground.
|
|
85
|
+
redirectUrl: "#connected",
|
|
86
|
+
}),
|
|
87
|
+
status: async (id) => {
|
|
88
|
+
const found = state.connections.find((candidate) => candidate.id === id);
|
|
89
|
+
return found ?? { id, connector: "composio", toolkit: "slack", status: "active" };
|
|
90
|
+
},
|
|
91
|
+
disconnect: async (id) => {
|
|
92
|
+
state.connections = state.connections.filter((candidate) => candidate.id !== id);
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
apps: {
|
|
96
|
+
list: async () => [...state.apps],
|
|
97
|
+
create: async ({ prompt }) => {
|
|
98
|
+
const created = {
|
|
99
|
+
format: "vendo/app@1",
|
|
100
|
+
id: `app_created_${state.apps.length + 1}`,
|
|
101
|
+
name: prompt.slice(0, 40) || "New app",
|
|
102
|
+
description: `Scripted playground app for “${prompt}”.`,
|
|
103
|
+
ui: "tree",
|
|
104
|
+
tree: state.apps[0]?.tree,
|
|
105
|
+
};
|
|
106
|
+
state.apps.push(created);
|
|
107
|
+
return created;
|
|
108
|
+
},
|
|
109
|
+
get: async (id) => app(id),
|
|
110
|
+
delete: async (id) => {
|
|
111
|
+
state.apps = state.apps.filter((candidate) => candidate.id !== id);
|
|
112
|
+
},
|
|
113
|
+
open: async (id) => {
|
|
114
|
+
const document = app(id);
|
|
115
|
+
if (!document.tree)
|
|
116
|
+
throw new VendoError("validation", `App ${id} has no tree surface`);
|
|
117
|
+
return { kind: "tree", payload: document.tree };
|
|
118
|
+
},
|
|
119
|
+
call: async () => ({ status: "ok", output: { ok: true } }),
|
|
120
|
+
pingMachine: async () => ({ state: "awake" }),
|
|
121
|
+
edit: async (id) => ({ app: app(id), version: { at: new Date().toISOString(), intent: "edit", rung: 2 } }),
|
|
122
|
+
history: async () => [{ at: "2026-07-18T09:05:30.000Z", intent: "create", rung: 2 }],
|
|
123
|
+
undo: async (id) => app(id),
|
|
124
|
+
exportApp: async (id) => new TextEncoder().encode(JSON.stringify(app(id))),
|
|
125
|
+
importApp: async (bytes) => {
|
|
126
|
+
const imported = JSON.parse(new TextDecoder().decode(bytes));
|
|
127
|
+
state.apps.push(imported);
|
|
128
|
+
return imported;
|
|
129
|
+
},
|
|
130
|
+
fork: async (id) => {
|
|
131
|
+
const source = app(id);
|
|
132
|
+
const fork = { ...source, id: `${source.id}_fork`, name: `${source.name} (fork)`, forkedFrom: source.id };
|
|
133
|
+
state.apps.push(fork);
|
|
134
|
+
return fork;
|
|
135
|
+
},
|
|
136
|
+
shipDiff: async (id) => ({ appId: id, versionHash: "sha256:playground", pins: [], generated: [] }),
|
|
137
|
+
pinDrift: async () => [],
|
|
138
|
+
forkPin: async ({ appId, slot }) => {
|
|
139
|
+
// Persist like the real runtime: the fork must land in the store so
|
|
140
|
+
// slot discovery (apps.list) can mount it. An empty-slot gesture
|
|
141
|
+
// mints a new app around the pin; a filled gesture pins in place.
|
|
142
|
+
const pin = { slot, base: "sha256:playground" };
|
|
143
|
+
let forked;
|
|
144
|
+
if (appId === undefined) {
|
|
145
|
+
forked = {
|
|
146
|
+
format: "vendo/app@1",
|
|
147
|
+
id: `app_remix_${state.apps.length + 1}`,
|
|
148
|
+
name: `${slot} remix`,
|
|
149
|
+
description: `Playground remix of the "${slot}" slot.`,
|
|
150
|
+
ui: "tree",
|
|
151
|
+
tree: state.apps[0]?.tree,
|
|
152
|
+
pins: [pin],
|
|
153
|
+
};
|
|
154
|
+
state.apps.push(forked);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
const target = app(appId);
|
|
158
|
+
forked = { ...target, pins: [...(target.pins ?? []), pin] };
|
|
159
|
+
state.apps = state.apps.map((candidate) => (candidate.id === appId ? forked : candidate));
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
app: forked,
|
|
163
|
+
version: { at: new Date().toISOString(), intent: `Remix the host component "${slot}"`, rung: 2 },
|
|
164
|
+
slot,
|
|
165
|
+
componentName: `Pinned${slot}`,
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
rebasePin: async (id, slot) => ({
|
|
169
|
+
status: "rebased",
|
|
170
|
+
app: app(id),
|
|
171
|
+
version: { at: new Date().toISOString(), intent: "rebase", rung: 2 },
|
|
172
|
+
slot,
|
|
173
|
+
baseHash: "sha256:playground",
|
|
174
|
+
replayed: [],
|
|
175
|
+
}),
|
|
176
|
+
},
|
|
177
|
+
automations: {
|
|
178
|
+
list: async () => state.automations.map((entry) => ({ ...entry })),
|
|
179
|
+
enable: async (id) => {
|
|
180
|
+
const entry = state.automations.find((candidate) => candidate.app.id === id);
|
|
181
|
+
if (entry)
|
|
182
|
+
entry.enabled = true;
|
|
183
|
+
return { enabled: true, missing: [] };
|
|
184
|
+
},
|
|
185
|
+
disable: async (id) => {
|
|
186
|
+
const entry = state.automations.find((candidate) => candidate.app.id === id);
|
|
187
|
+
if (entry)
|
|
188
|
+
entry.enabled = false;
|
|
189
|
+
},
|
|
190
|
+
dryRun: async () => ({
|
|
191
|
+
steps: [
|
|
192
|
+
{ id: "step_1", tool: "host_listRenewals", wouldAsk: false },
|
|
193
|
+
{ id: "step_2", tool: "slack_SLACK_SEND_MESSAGE", wouldAsk: true },
|
|
194
|
+
],
|
|
195
|
+
grantsMissing: [],
|
|
196
|
+
}),
|
|
197
|
+
},
|
|
198
|
+
runs: {
|
|
199
|
+
list: async (filter) => ({
|
|
200
|
+
runs: state.runs.filter((run) => (filter?.appId === undefined ? true : run.appId === filter.appId)),
|
|
201
|
+
}),
|
|
202
|
+
get: async (id) => {
|
|
203
|
+
const found = state.runs.find((run) => run.id === id);
|
|
204
|
+
if (!found)
|
|
205
|
+
throw new VendoError("not-found", `Unknown run ${id}`);
|
|
206
|
+
return found;
|
|
207
|
+
},
|
|
208
|
+
stop: async () => undefined,
|
|
209
|
+
},
|
|
210
|
+
activity: {
|
|
211
|
+
list: async () => [...fixtures.activity],
|
|
212
|
+
},
|
|
213
|
+
status: async () => fixtures.status,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playground fixtures — every scenario renders the REAL chrome against these:
|
|
3
|
+
* director-mode scripts (the `DirectorScript` format the demo-host fixtures
|
|
4
|
+
* already use, see packages/ui/src/hooks/scripted-transport.ts) for streamed
|
|
5
|
+
* turns, and static wire payloads served by the in-page fake client for
|
|
6
|
+
* everything the collection hooks fetch. No model key, no network.
|
|
7
|
+
*/
|
|
8
|
+
import type { AppDocument, ApprovalRequest, AuditEvent, PermissionGrant, UIPayload } from "@vendoai/core";
|
|
9
|
+
import type { AutomationEntry, ConnectionAccount, DirectorScript, RunRecord, Thread, ThreadSummary, ToolMetaMap, VendoStatus } from "@vendoai/ui";
|
|
10
|
+
/** Friendly labels so build beats speak like a host would make them speak. */
|
|
11
|
+
export declare const playgroundToolMeta: ToolMetaMap;
|
|
12
|
+
/** The finished "Renewals radar" view — also the slot's pinned payload. */
|
|
13
|
+
export declare function renewalsViewPayload(): UIPayload;
|
|
14
|
+
/** A deliberately broken payload. The renderer is fail-soft about CONTENT
|
|
15
|
+
* problems (bad root, missing components → contained notices), so to reach
|
|
16
|
+
* the slot's recovery path this has to crash the renderer itself: a partial
|
|
17
|
+
* (`streaming: true`) payload whose `nodes` is malformed throws host-side in
|
|
18
|
+
* TreeView, outside the per-node boundaries — and VendoSlot's PinMount
|
|
19
|
+
* boundary keeps the host's original children visible (06-apps §8). */
|
|
20
|
+
export declare function brokenViewPayload(): UIPayload;
|
|
21
|
+
/** A long, slowly streaming text turn — the "streaming" screenshot state. */
|
|
22
|
+
export declare function streamingScript(): DirectorScript;
|
|
23
|
+
/** Tool beats → a generated view streaming in → a closing summary. */
|
|
24
|
+
export declare function viewScript(): DirectorScript;
|
|
25
|
+
/** Turn 0 parks on a write approval; deciding it resumes turn 1 (03-agent §4). */
|
|
26
|
+
export declare function approvalScript(): DirectorScript;
|
|
27
|
+
/** A connector call that needs a per-user connected account first (04 §3). */
|
|
28
|
+
export declare function connectScript(): DirectorScript;
|
|
29
|
+
export interface PlaygroundFixtures {
|
|
30
|
+
status: VendoStatus;
|
|
31
|
+
threads: Array<ThreadSummary & {
|
|
32
|
+
thread: Thread;
|
|
33
|
+
}>;
|
|
34
|
+
apps: AppDocument[];
|
|
35
|
+
automations: AutomationEntry[];
|
|
36
|
+
connections: ConnectionAccount[];
|
|
37
|
+
approvals: ApprovalRequest[];
|
|
38
|
+
grants: PermissionGrant[];
|
|
39
|
+
activity: AuditEvent[];
|
|
40
|
+
runs: RunRecord[];
|
|
41
|
+
}
|
|
42
|
+
/** The Activities empty state: a workspace where the agent has not acted yet —
|
|
43
|
+
* no pending approvals, no audit trail. Everything else stays populated so
|
|
44
|
+
* the surface sits in a realistic host page. */
|
|
45
|
+
export declare function emptyActivitiesFixtures(): PlaygroundFixtures;
|
|
46
|
+
/** Fresh copies every call: scenario state never leaks between mounts. */
|
|
47
|
+
export declare function playgroundFixtures(): PlaygroundFixtures;
|