@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
package/dist/mastra.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type VendoToolPackFilter } from "@vendoai/agent";
|
|
2
|
+
import { type Tool } from "@mastra/core/tools";
|
|
3
|
+
import type { Vendo } from "./server.js";
|
|
4
|
+
/**
|
|
5
|
+
* `@vendoai/vendo/mastra` — the BYO-agent seam for Mastra agents (frozen
|
|
6
|
+
* contract: docs/superpowers/specs/2026-07-20-existing-agents-contracts.md §2,
|
|
7
|
+
* async return amended Wave 1). The same framework-neutral tool pack as
|
|
8
|
+
* `./ai-sdk`, in Mastra `createTool` shape for the `Agent({ tools })` map.
|
|
9
|
+
*
|
|
10
|
+
* A Mastra agent definition is STATIC — one definition serves every user — so
|
|
11
|
+
* this shim takes no principal. Each call resolves its principal (and optional
|
|
12
|
+
* session id) lazily from Mastra's request context:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* const requestContext = new RequestContext();
|
|
16
|
+
* requestContext.set(VENDO_PRINCIPAL_KEY, { kind: "user", subject: userId });
|
|
17
|
+
* requestContext.set(VENDO_SESSION_KEY, hostSessionId); // optional
|
|
18
|
+
* await agent.stream(messages, { requestContext });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export { VENDO_CREATE_APP_TOOL, VENDO_DELEGATE_TOOL, VENDO_TOOL_PACK_PREFIX, type VendoDelegateResult, type VendoToolPackFilter, } from "@vendoai/agent";
|
|
22
|
+
/** Request-context key holding the caller's Vendo `Principal` (`{ kind, subject }`).
|
|
23
|
+
* REQUIRED on every request that may reach a `vendo_*` tool — a missing or
|
|
24
|
+
* malformed principal fails the call closed. */
|
|
25
|
+
export declare const VENDO_PRINCIPAL_KEY = "vendo-principal";
|
|
26
|
+
/** Optional request-context key carrying the host session id into Vendo's
|
|
27
|
+
* audit trail; unset, the shim mints one per call. */
|
|
28
|
+
export declare const VENDO_SESSION_KEY = "vendo-session-id";
|
|
29
|
+
export type VendoMastraTool = Tool<unknown, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Build the Vendo tool pack as Mastra tools. Async (the pack enumerates the
|
|
32
|
+
* live registry), which composes with a static agent either way:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* // ESM top-level await:
|
|
36
|
+
* const agent = new Agent({ tools: { ...weatherTool, ...(await vendoMastraTools(vendo)) } });
|
|
37
|
+
* // or Mastra's dynamic tools function:
|
|
38
|
+
* const agent = new Agent({ tools: () => vendoMastraTools(vendo) });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* A `vendo_*` tool returns either a versioned envelope — `vendo/app-ref@1`
|
|
42
|
+
* (render with `<VendoAppEmbed>`) or `vendo/approval-ref@1` (parks server-side;
|
|
43
|
+
* render with `<VendoApprovalEmbed>`) — or plain data, meaning the guarded
|
|
44
|
+
* call executed cleanly.
|
|
45
|
+
*/
|
|
46
|
+
export declare function vendoMastraTools(vendo: Vendo, options?: VendoToolPackFilter): Promise<Record<string, VendoMastraTool>>;
|
package/dist/mastra.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { buildVendoToolPack } from "@vendoai/agent";
|
|
2
|
+
import { VendoError } from "@vendoai/core";
|
|
3
|
+
// Static import of an OPTIONAL peer: this module only loads when the host
|
|
4
|
+
// imports `@vendoai/vendo/mastra`, and a Mastra host has @mastra/core by
|
|
5
|
+
// definition. Nothing outside this subpath touches it.
|
|
6
|
+
import { createTool } from "@mastra/core/tools";
|
|
7
|
+
/**
|
|
8
|
+
* `@vendoai/vendo/mastra` — the BYO-agent seam for Mastra agents (frozen
|
|
9
|
+
* contract: docs/superpowers/specs/2026-07-20-existing-agents-contracts.md §2,
|
|
10
|
+
* async return amended Wave 1). The same framework-neutral tool pack as
|
|
11
|
+
* `./ai-sdk`, in Mastra `createTool` shape for the `Agent({ tools })` map.
|
|
12
|
+
*
|
|
13
|
+
* A Mastra agent definition is STATIC — one definition serves every user — so
|
|
14
|
+
* this shim takes no principal. Each call resolves its principal (and optional
|
|
15
|
+
* session id) lazily from Mastra's request context:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const requestContext = new RequestContext();
|
|
19
|
+
* requestContext.set(VENDO_PRINCIPAL_KEY, { kind: "user", subject: userId });
|
|
20
|
+
* requestContext.set(VENDO_SESSION_KEY, hostSessionId); // optional
|
|
21
|
+
* await agent.stream(messages, { requestContext });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export { VENDO_CREATE_APP_TOOL, VENDO_DELEGATE_TOOL, VENDO_TOOL_PACK_PREFIX, } from "@vendoai/agent";
|
|
25
|
+
/** Request-context key holding the caller's Vendo `Principal` (`{ kind, subject }`).
|
|
26
|
+
* REQUIRED on every request that may reach a `vendo_*` tool — a missing or
|
|
27
|
+
* malformed principal fails the call closed. */
|
|
28
|
+
export const VENDO_PRINCIPAL_KEY = "vendo-principal";
|
|
29
|
+
/** Optional request-context key carrying the host session id into Vendo's
|
|
30
|
+
* audit trail; unset, the shim mints one per call. */
|
|
31
|
+
export const VENDO_SESSION_KEY = "vendo-session-id";
|
|
32
|
+
function principalFrom(context) {
|
|
33
|
+
const candidate = context?.requestContext?.get(VENDO_PRINCIPAL_KEY);
|
|
34
|
+
if (typeof candidate?.kind !== "string" || typeof candidate.subject !== "string") {
|
|
35
|
+
throw new VendoError("validation", `vendo tools need the caller's principal: set requestContext "${VENDO_PRINCIPAL_KEY}" to { kind, subject } before invoking the agent`);
|
|
36
|
+
}
|
|
37
|
+
return candidate;
|
|
38
|
+
}
|
|
39
|
+
function runContextFrom(context) {
|
|
40
|
+
const session = context?.requestContext?.get(VENDO_SESSION_KEY);
|
|
41
|
+
return {
|
|
42
|
+
principal: principalFrom(context),
|
|
43
|
+
// The frozen BYO context tuple — a chat surface that is not Vendo's, with
|
|
44
|
+
// the user present. Park-and-resume replays pin this tuple.
|
|
45
|
+
venue: "chat",
|
|
46
|
+
presence: "present",
|
|
47
|
+
sessionId: typeof session === "string" && session.length > 0
|
|
48
|
+
? session
|
|
49
|
+
: `session_${globalThis.crypto.randomUUID()}`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build the Vendo tool pack as Mastra tools. Async (the pack enumerates the
|
|
54
|
+
* live registry), which composes with a static agent either way:
|
|
55
|
+
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* // ESM top-level await:
|
|
58
|
+
* const agent = new Agent({ tools: { ...weatherTool, ...(await vendoMastraTools(vendo)) } });
|
|
59
|
+
* // or Mastra's dynamic tools function:
|
|
60
|
+
* const agent = new Agent({ tools: () => vendoMastraTools(vendo) });
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* A `vendo_*` tool returns either a versioned envelope — `vendo/app-ref@1`
|
|
64
|
+
* (render with `<VendoAppEmbed>`) or `vendo/approval-ref@1` (parks server-side;
|
|
65
|
+
* render with `<VendoApprovalEmbed>`) — or plain data, meaning the guarded
|
|
66
|
+
* call executed cleanly.
|
|
67
|
+
*/
|
|
68
|
+
export async function vendoMastraTools(vendo, options) {
|
|
69
|
+
const pack = await buildVendoToolPack({
|
|
70
|
+
registry: vendo.guardedTools,
|
|
71
|
+
runner: vendo.agent.asRunner(),
|
|
72
|
+
...(options?.include === undefined ? {} : { include: options.include }),
|
|
73
|
+
...(options?.exclude === undefined ? {} : { exclude: options.exclude }),
|
|
74
|
+
});
|
|
75
|
+
const tools = {};
|
|
76
|
+
for (const entry of pack) {
|
|
77
|
+
tools[entry.name] = createTool({
|
|
78
|
+
id: entry.name,
|
|
79
|
+
description: entry.description,
|
|
80
|
+
inputSchema: entry.inputSchema,
|
|
81
|
+
execute: (inputData, context) => entry.execute(inputData, {
|
|
82
|
+
ctx: runContextFrom(context),
|
|
83
|
+
...(context?.agent?.toolCallId === undefined ? {} : { callId: context.agent.toolCallId }),
|
|
84
|
+
}),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return tools;
|
|
88
|
+
}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VendoProvider } from "@vendoai/ui";
|
|
2
|
+
import { type ComponentProps } from "react";
|
|
3
|
+
export { createVendoClient, type VendoClient, type VendoClientConfig, VendoProvider, hostComponentMap, useVendoContext, useVendoDiscoverability, useVendoGreeting, useVendoTheme, useVendoTools, type ConnectorOption, type HostComponentsInput, defaultVendoGreeting, type VendoDiscoverability, type VendoGreeting, type ToolMeta, type ToolMetaMap, VendoAppEmbed, VendoApprovalEmbed, VendoToolResult, useActivity, useApp, useApps, useApprovals, useAutomations, useConnections, useConnectorCatalog, useGrants, useMobileTakeover, type MobileTakeover, type PollOptions, useSlotApp, useThreads, useVendoOverlay, type VendoOverlayController, useVendoStatus, useVendoThread, type VendoThreadApproval, ScriptedTransport, type DirectorCue, type DirectorScript, defaultVendoTheme, resolveTheme, themeCssVariables, useVoice, type UseVoiceResult, type OpenSurface, type InClientVenue, type PinDrift, type ShipDiff, type EditResult, type PinRebaseResult, type VersionEntry, type ConnectionAccount, type InitiatedConnection, type RunStatus, type RunRecord, type RunPlan, type AutomationEntry, type EnableResult, type Thread, type ThreadSummary, type GuardPosture, type VendoStatus, } from "@vendoai/ui";
|
|
4
|
+
export { remixable, type RemixableRegistration, type RemixableReportOptions } from "./remixable.js";
|
|
5
|
+
type ProviderProps = ComponentProps<typeof VendoProvider>;
|
|
6
|
+
/** 09-vendo §1 — the UI provider prewired to the default wire base. */
|
|
7
|
+
export declare function VendoRoot(props: Omit<ProviderProps, "client"> & {
|
|
8
|
+
client?: ProviderProps["client"];
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
}): ReturnType<typeof VendoProvider>;
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createVendoClient, VendoProvider } from "@vendoai/ui";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
// Named re-exports, not `export *`: this file is a "use client" boundary, and
|
|
6
|
+
// Next's flight loader builds the client-reference manifest by statically
|
|
7
|
+
// enumerating a client module's named exports — it cannot do that through
|
|
8
|
+
// `export *`. This list must stay in exact parity with @vendoai/ui's public
|
|
9
|
+
// surface (packages/ui/src/index.ts); react-export-parity.test.ts fails loudly
|
|
10
|
+
// if a future ui export is missing here.
|
|
11
|
+
export {
|
|
12
|
+
// client.ts
|
|
13
|
+
createVendoClient,
|
|
14
|
+
// context.ts
|
|
15
|
+
VendoProvider, hostComponentMap, useVendoContext, useVendoDiscoverability, useVendoGreeting, useVendoTheme, useVendoTools,
|
|
16
|
+
// chrome/discoverability.ts
|
|
17
|
+
defaultVendoGreeting,
|
|
18
|
+
// chrome/embeds.tsx — the BYO-agent embeds (existing-agents)
|
|
19
|
+
VendoAppEmbed, VendoApprovalEmbed, VendoToolResult,
|
|
20
|
+
// hooks/*
|
|
21
|
+
useActivity, useApp, useApps, useApprovals, useAutomations, useConnections, useConnectorCatalog, useGrants, useMobileTakeover, useSlotApp, useThreads, useVendoOverlay, useVendoStatus, useVendoThread, ScriptedTransport,
|
|
22
|
+
// theme.ts
|
|
23
|
+
defaultVendoTheme, resolveTheme, themeCssVariables,
|
|
24
|
+
// voice/use-voice.ts
|
|
25
|
+
useVoice, } from "@vendoai/ui";
|
|
26
|
+
export { remixable } from "./remixable.js";
|
|
27
|
+
/** 09-vendo §1 — the UI provider prewired to the default wire base. */
|
|
28
|
+
export function VendoRoot(props) {
|
|
29
|
+
const { client: configuredClient, baseUrl = "/api/vendo", ...providerProps } = props;
|
|
30
|
+
const defaultClient = useMemo(() => createVendoClient({ baseUrl }), [baseUrl]);
|
|
31
|
+
return _jsx(VendoProvider, { ...providerProps, client: configuredClient ?? defaultClient });
|
|
32
|
+
}
|
package/dist/refine.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { type CapabilityMissEvent } from "@vendoai/core";
|
|
2
|
+
import type { LanguageModel } from "ai";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
export interface RefineOptions {
|
|
5
|
+
/** Host app root: `.vendo/` artifacts and source are read from here. */
|
|
6
|
+
root: string;
|
|
7
|
+
/** BYO ai-SDK model — the same provider-agnostic seam as `createVendo({ model })`. */
|
|
8
|
+
model: LanguageModel;
|
|
9
|
+
/** Mounted Vendo wire base of the running dev app (e.g. http://localhost:3000/api/vendo). */
|
|
10
|
+
url?: string;
|
|
11
|
+
fetchImpl?: typeof fetch;
|
|
12
|
+
/** Dev-interview answers (the CLI collects them; a hosted run passes transcripts). */
|
|
13
|
+
interview?: string[];
|
|
14
|
+
/** Injected miss feed; default reads `.vendo/data/misses.jsonl`. */
|
|
15
|
+
misses?: CapabilityMissEvent[];
|
|
16
|
+
/** Char budget for the source-context leg. */
|
|
17
|
+
sourceBudget?: number;
|
|
18
|
+
maxMisses?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface RefineProbeCheck {
|
|
21
|
+
name: string;
|
|
22
|
+
ok: boolean;
|
|
23
|
+
detail: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RefineProbe {
|
|
26
|
+
tool: string;
|
|
27
|
+
/** verified = at least one live check passed and none failed; static-only = no live check possible. */
|
|
28
|
+
status: "verified" | "static-only" | "failed";
|
|
29
|
+
checks: RefineProbeCheck[];
|
|
30
|
+
}
|
|
31
|
+
export interface RefineChange {
|
|
32
|
+
/** Path relative to root (e.g. `.vendo/capabilities.json`). */
|
|
33
|
+
path: string;
|
|
34
|
+
before: string | null;
|
|
35
|
+
after: string;
|
|
36
|
+
diff: string;
|
|
37
|
+
/** Human-visible cautions (e.g. a proposed risk downgrade) shown beside the diff. */
|
|
38
|
+
warnings: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface RefineDrop {
|
|
41
|
+
kind: "compound" | "brief" | "override" | "description" | "brief-update";
|
|
42
|
+
target: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
}
|
|
45
|
+
/** The cloud-seam run record: inputs digest, raw proposals, probe results, and
|
|
46
|
+
* (once the caller applies) decisions. Plain JSON under `.vendo/data/refine/`
|
|
47
|
+
* — deliberately NOT a `vendo/*@N` contract format. */
|
|
48
|
+
export interface RefineTranscript {
|
|
49
|
+
version: 0;
|
|
50
|
+
startedAt: string;
|
|
51
|
+
root: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
inputs: {
|
|
54
|
+
tools: number;
|
|
55
|
+
misses: number;
|
|
56
|
+
interview: string[];
|
|
57
|
+
sourceFiles: string[];
|
|
58
|
+
};
|
|
59
|
+
proposals: RefineProposals;
|
|
60
|
+
dropped: RefineDrop[];
|
|
61
|
+
probes: RefineProbe[];
|
|
62
|
+
decisions: Array<{
|
|
63
|
+
path: string;
|
|
64
|
+
applied: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
export interface RefineResult {
|
|
68
|
+
changes: RefineChange[];
|
|
69
|
+
probes: RefineProbe[];
|
|
70
|
+
dropped: RefineDrop[];
|
|
71
|
+
transcript: RefineTranscript;
|
|
72
|
+
}
|
|
73
|
+
declare const proposalsSchema: z.ZodObject<{
|
|
74
|
+
compounds: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
78
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
tool: z.ZodString;
|
|
81
|
+
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
82
|
+
if: z.ZodOptional<z.ZodString>;
|
|
83
|
+
forEach: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
tool: string;
|
|
86
|
+
id: string;
|
|
87
|
+
forEach?: string | undefined;
|
|
88
|
+
if?: string | undefined;
|
|
89
|
+
args?: Record<string, string> | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
tool: string;
|
|
92
|
+
id: string;
|
|
93
|
+
forEach?: string | undefined;
|
|
94
|
+
if?: string | undefined;
|
|
95
|
+
args?: Record<string, string> | undefined;
|
|
96
|
+
}>, "many">;
|
|
97
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
steps: {
|
|
102
|
+
tool: string;
|
|
103
|
+
id: string;
|
|
104
|
+
forEach?: string | undefined;
|
|
105
|
+
if?: string | undefined;
|
|
106
|
+
args?: Record<string, string> | undefined;
|
|
107
|
+
}[];
|
|
108
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
109
|
+
rationale?: string | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
name: string;
|
|
112
|
+
description: string;
|
|
113
|
+
steps: {
|
|
114
|
+
tool: string;
|
|
115
|
+
id: string;
|
|
116
|
+
forEach?: string | undefined;
|
|
117
|
+
if?: string | undefined;
|
|
118
|
+
args?: Record<string, string> | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
121
|
+
rationale?: string | undefined;
|
|
122
|
+
}>, "many">>;
|
|
123
|
+
briefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
text: z.ZodString;
|
|
126
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
name: string;
|
|
129
|
+
text: string;
|
|
130
|
+
tools?: string[] | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
name: string;
|
|
133
|
+
text: string;
|
|
134
|
+
tools?: string[] | undefined;
|
|
135
|
+
}>, "many">>;
|
|
136
|
+
riskCorrections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
137
|
+
tool: z.ZodString;
|
|
138
|
+
risk: z.ZodEnum<["read", "write", "destructive"]>;
|
|
139
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
tool: string;
|
|
142
|
+
risk: "read" | "write" | "destructive";
|
|
143
|
+
reason?: string | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
tool: string;
|
|
146
|
+
risk: "read" | "write" | "destructive";
|
|
147
|
+
reason?: string | undefined;
|
|
148
|
+
}>, "many">>;
|
|
149
|
+
curation: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
150
|
+
tool: z.ZodString;
|
|
151
|
+
disabled: z.ZodBoolean;
|
|
152
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
tool: string;
|
|
155
|
+
disabled: boolean;
|
|
156
|
+
reason?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
tool: string;
|
|
159
|
+
disabled: boolean;
|
|
160
|
+
reason?: string | undefined;
|
|
161
|
+
}>, "many">>;
|
|
162
|
+
descriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
163
|
+
tool: z.ZodString;
|
|
164
|
+
description: z.ZodString;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
tool: string;
|
|
167
|
+
description: string;
|
|
168
|
+
}, {
|
|
169
|
+
tool: string;
|
|
170
|
+
description: string;
|
|
171
|
+
}>, "many">>;
|
|
172
|
+
briefUpdate: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
compounds?: {
|
|
175
|
+
name: string;
|
|
176
|
+
description: string;
|
|
177
|
+
steps: {
|
|
178
|
+
tool: string;
|
|
179
|
+
id: string;
|
|
180
|
+
forEach?: string | undefined;
|
|
181
|
+
if?: string | undefined;
|
|
182
|
+
args?: Record<string, string> | undefined;
|
|
183
|
+
}[];
|
|
184
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
185
|
+
rationale?: string | undefined;
|
|
186
|
+
}[] | undefined;
|
|
187
|
+
briefs?: {
|
|
188
|
+
name: string;
|
|
189
|
+
text: string;
|
|
190
|
+
tools?: string[] | undefined;
|
|
191
|
+
}[] | undefined;
|
|
192
|
+
riskCorrections?: {
|
|
193
|
+
tool: string;
|
|
194
|
+
risk: "read" | "write" | "destructive";
|
|
195
|
+
reason?: string | undefined;
|
|
196
|
+
}[] | undefined;
|
|
197
|
+
curation?: {
|
|
198
|
+
tool: string;
|
|
199
|
+
disabled: boolean;
|
|
200
|
+
reason?: string | undefined;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
descriptions?: {
|
|
203
|
+
tool: string;
|
|
204
|
+
description: string;
|
|
205
|
+
}[] | undefined;
|
|
206
|
+
briefUpdate?: string | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
compounds?: {
|
|
209
|
+
name: string;
|
|
210
|
+
description: string;
|
|
211
|
+
steps: {
|
|
212
|
+
tool: string;
|
|
213
|
+
id: string;
|
|
214
|
+
forEach?: string | undefined;
|
|
215
|
+
if?: string | undefined;
|
|
216
|
+
args?: Record<string, string> | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
inputSchema?: Record<string, unknown> | undefined;
|
|
219
|
+
rationale?: string | undefined;
|
|
220
|
+
}[] | undefined;
|
|
221
|
+
briefs?: {
|
|
222
|
+
name: string;
|
|
223
|
+
text: string;
|
|
224
|
+
tools?: string[] | undefined;
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
riskCorrections?: {
|
|
227
|
+
tool: string;
|
|
228
|
+
risk: "read" | "write" | "destructive";
|
|
229
|
+
reason?: string | undefined;
|
|
230
|
+
}[] | undefined;
|
|
231
|
+
curation?: {
|
|
232
|
+
tool: string;
|
|
233
|
+
disabled: boolean;
|
|
234
|
+
reason?: string | undefined;
|
|
235
|
+
}[] | undefined;
|
|
236
|
+
descriptions?: {
|
|
237
|
+
tool: string;
|
|
238
|
+
description: string;
|
|
239
|
+
}[] | undefined;
|
|
240
|
+
briefUpdate?: string | undefined;
|
|
241
|
+
}>;
|
|
242
|
+
export type RefineProposals = z.infer<typeof proposalsSchema>;
|
|
243
|
+
export declare function runRefine(options: RefineOptions): Promise<RefineResult>;
|
|
244
|
+
export {};
|