@agent-native/core 0.58.2 → 0.58.4
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/dist/agent/engine/translate-ai-sdk.d.ts.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.js +1 -0
- package/dist/agent/engine/translate-ai-sdk.js.map +1 -1
- package/dist/agent/production-agent.d.ts +11 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +168 -11
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/tool-error-redaction.d.ts +4 -0
- package/dist/agent/tool-error-redaction.d.ts.map +1 -0
- package/dist/agent/tool-error-redaction.js +43 -0
- package/dist/agent/tool-error-redaction.js.map +1 -0
- package/dist/agent/types.d.ts +23 -6
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/plan-local.d.ts +34 -0
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +205 -1
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts +5 -0
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +19 -2
- package/dist/cli/recap.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +5 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +141 -39
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +44 -31
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/blocks/library/diagram.d.ts.map +1 -1
- package/dist/client/blocks/library/diagram.js +85 -20
- package/dist/client/blocks/library/diagram.js.map +1 -1
- package/dist/client/blocks/library/tabs.d.ts.map +1 -1
- package/dist/client/blocks/library/tabs.js +5 -5
- package/dist/client/blocks/library/tabs.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +13 -10
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +3 -3
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +0 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +5 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/widgets/DataChartRenderer.d.ts.map +1 -1
- package/dist/client/chat/widgets/DataChartRenderer.js +98 -21
- package/dist/client/chat/widgets/DataChartRenderer.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts +4 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +30 -4
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/composer/AgentComposerFrame.js +1 -1
- package/dist/client/composer/AgentComposerFrame.js.map +1 -1
- package/dist/scripts/db/tool-schemas.d.ts +3 -0
- package/dist/scripts/db/tool-schemas.d.ts.map +1 -0
- package/dist/scripts/db/tool-schemas.js +27 -0
- package/dist/scripts/db/tool-schemas.js.map +1 -0
- package/dist/scripts/dev/index.d.ts.map +1 -1
- package/dist/scripts/dev/index.js +2 -22
- package/dist/scripts/dev/index.js.map +1 -1
- package/dist/scripts/parse-args.js +1 -1
- package/dist/scripts/parse-args.js.map +1 -1
- package/dist/scripts/runner.js +1 -1
- package/dist/scripts/runner.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +17 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +8 -24
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/cli-capture.d.ts.map +1 -1
- package/dist/server/cli-capture.js +2 -1
- package/dist/server/cli-capture.js.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -1
- package/dist/sharing/actions/set-resource-visibility.js +25 -11
- package/dist/sharing/actions/set-resource-visibility.js.map +1 -1
- package/dist/styles/agent-native.css +115 -2
- package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +100 -0
- package/docs/content/pr-visual-recap.md +2 -2
- package/package.json +2 -1
- package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +100 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-capture.d.ts","sourceRoot":"","sources":["../../src/server/cli-capture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-capture.d.ts","sourceRoot":"","sources":["../../src/server/cli-capture.ts"],"names":[],"mappings":"AAyBA,gEAAgE;AAChE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,IAAI,EAAE,MAAM,CAAC;gBACD,IAAI,EAAE,MAAM;CAIzB;AA0DD,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC1B,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGpD"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* idempotent and safe under any number of concurrent runs.
|
|
16
16
|
*/
|
|
17
17
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
|
+
import { sanitizeToolErrorText } from "../agent/tool-error-redaction.js";
|
|
18
19
|
const captureStore = new AsyncLocalStorage();
|
|
19
20
|
/** Sentinel thrown when an action calls `process.exit(...)`. */
|
|
20
21
|
export class ExitIntercepted extends Error {
|
|
@@ -99,7 +100,7 @@ export async function captureCliOutput(fn, options = {}) {
|
|
|
99
100
|
}
|
|
100
101
|
else if (swallowErrors) {
|
|
101
102
|
const msg = err?.message ?? String(err);
|
|
102
|
-
store.logs.push(`Error: ${msg}`);
|
|
103
|
+
store.logs.push(sanitizeToolErrorText(`Error: ${msg}`));
|
|
103
104
|
}
|
|
104
105
|
else {
|
|
105
106
|
throw err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-capture.js","sourceRoot":"","sources":["../../src/server/cli-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-capture.js","sourceRoot":"","sources":["../../src/server/cli-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAMzE,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAgB,CAAC;AAE3D,gEAAgE;AAChE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,IAAI,CAAS;IACb,YAAY,IAAY;QACtB,KAAK,CAAC,gBAAgB,IAAI,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,uBAAuB;IAC9B,IAAI,SAAS;QAAE,OAAO;IACtB,SAAS,GAAG,IAAI,CAAC;IAEjB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,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,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,eAAe,EAAE,CAAC;YACnC,sEAAsE;QACxE,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACzB,MAAM,GAAG,GAAI,GAAa,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YACnD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IACtC,IAAI,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/**\n * Capture stdout/stderr/console output from CLI-style action handlers\n * without globally swapping `console.log` / `process.stdout.write` /\n * `process.exit` per-call.\n *\n * The previous pattern (save → swap → restore in finally) corrupts the\n * globals when two CLI tool calls run concurrently — request B saves the\n * already-swapped function, then both finally-blocks restore in interleaved\n * order, leaving an arbitrary capture function permanently installed and\n * silently swallowing all subsequent server logs.\n *\n * This module installs the global interceptors ONCE at module load. Each\n * call dispatches to either the captured logs (when an AsyncLocalStorage\n * store is active) or the original implementation. The wrappers are\n * idempotent and safe under any number of concurrent runs.\n */\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { sanitizeToolErrorText } from \"../agent/tool-error-redaction.js\";\n\ninterface CaptureStore {\n logs: string[];\n}\n\nconst captureStore = new AsyncLocalStorage<CaptureStore>();\n\n/** Sentinel thrown when an action calls `process.exit(...)`. */\nexport class ExitIntercepted extends Error {\n code: number;\n constructor(code: number) {\n super(`process.exit(${code})`);\n this.code = code;\n }\n}\n\nlet installed = false;\n\nfunction installInterceptorsOnce(): void {\n if (installed) return;\n installed = true;\n\n const origLog = console.log.bind(console);\n const origError = console.error.bind(console);\n const origStdoutWrite = process.stdout.write.bind(process.stdout);\n const origExit = process.exit.bind(process);\n\n console.log = (...args: unknown[]): void => {\n const store = captureStore.getStore();\n if (store) {\n store.logs.push(args.map((a) => String(a)).join(\" \"));\n return;\n }\n origLog(...(args as []));\n };\n\n console.error = (...args: unknown[]): void => {\n const store = captureStore.getStore();\n if (store) {\n store.logs.push(args.map((a) => String(a)).join(\" \"));\n return;\n }\n origError(...(args as []));\n };\n\n // process.stdout.write has a complex signature (string | Uint8Array, encoding?, callback?)\n // We only need to capture chunks; preserve return value semantics by returning true.\n process.stdout.write = ((chunk: any, ...rest: any[]) => {\n const store = captureStore.getStore();\n if (store) {\n if (typeof chunk === \"string\") {\n store.logs.push(chunk);\n } else if (chunk && typeof (chunk as Buffer).toString === \"function\") {\n store.logs.push((chunk as Buffer).toString());\n }\n // Honor the optional callback that streams expect.\n const cb = rest.find((r) => typeof r === \"function\");\n if (cb) (cb as (err?: Error | null) => void)(null);\n return true;\n }\n return origStdoutWrite(chunk, ...rest);\n }) as typeof process.stdout.write;\n\n process.exit = ((code?: number) => {\n const store = captureStore.getStore();\n if (store) {\n throw new ExitIntercepted(code ?? 0);\n }\n return origExit(code);\n }) as typeof process.exit;\n}\n\nexport interface CaptureCliOptions {\n /**\n * If `true` (default), errors thrown by `fn` (other than\n * `ExitIntercepted`) are appended to the capture buffer as `\"Error: ...\"`\n * and the resolved logs are returned. If `false`, errors propagate.\n */\n swallowErrors?: boolean;\n}\n\n/**\n * Run `fn` with a fresh capture buffer. All console.log / console.error /\n * process.stdout.write calls inside `fn` (including async descendants)\n * append to the buffer instead of going to the server's stdout/stderr.\n * Returns the joined logs (or `\"(no output)\"` if nothing was captured).\n *\n * `process.exit(code)` inside `fn` throws `ExitIntercepted` internally; it\n * is caught here so the captured output (including any final logs the\n * action wrote before exiting) is preserved.\n */\nexport async function captureCliOutput(\n fn: () => Promise<unknown>,\n options: CaptureCliOptions = {},\n): Promise<string> {\n installInterceptorsOnce();\n const store: CaptureStore = { logs: [] };\n const swallowErrors = options.swallowErrors !== false;\n try {\n await captureStore.run(store, fn);\n } catch (err) {\n if (err instanceof ExitIntercepted) {\n // process.exit() is treated as a clean termination of the CLI action.\n } else if (swallowErrors) {\n const msg = (err as Error)?.message ?? String(err);\n store.logs.push(sanitizeToolErrorText(`Error: ${msg}`));\n } else {\n throw err;\n }\n }\n return store.logs.join(\"\\n\") || \"(no output)\";\n}\n\n/**\n * Append a string to the active capture buffer. No-op outside of a\n * `captureCliOutput` scope — used by callers that catch errors from\n * `fn` themselves and want to emit the message into the captured logs.\n */\nexport function appendCapturedLog(text: string): void {\n const store = captureStore.getStore();\n if (store) store.logs.push(text);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-resource-visibility.d.ts","sourceRoot":"","sources":["../../../src/sharing/actions/set-resource-visibility.ts"],"names":[],"mappings":";;;;;;;;AAeA,
|
|
1
|
+
{"version":3,"file":"set-resource-visibility.d.ts","sourceRoot":"","sources":["../../../src/sharing/actions/set-resource-visibility.ts"],"names":[],"mappings":";;;;;;;;AAeA,wBAwEG"}
|
|
@@ -23,20 +23,34 @@ export default defineAction({
|
|
|
23
23
|
throw new ForbiddenError(`${reg.displayName} cannot be made public — share with specific people or your organization instead.`);
|
|
24
24
|
}
|
|
25
25
|
const access = await assertAccess(args.resourceType, args.resourceId, "admin");
|
|
26
|
-
const beforeExtensionTargets = await getExtensionShareChangeTargets(args.resourceType, args.resourceId);
|
|
27
26
|
const db = reg.getDb();
|
|
28
27
|
const update = { visibility: args.visibility };
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
const rawAccess = currentAccess();
|
|
29
|
+
const currentOrgId = resolveRegisteredAccessContext(reg, rawAccess).orgId;
|
|
30
|
+
if (args.visibility === "org" && !access.resource?.orgId) {
|
|
31
|
+
if (!currentOrgId) {
|
|
32
|
+
const canKeepResourceUnscoped = !!rawAccess.orgId &&
|
|
33
|
+
!!reg.resolveAccessContext &&
|
|
34
|
+
access.role === "owner";
|
|
35
|
+
// Some templates intentionally normalize local single-user resources
|
|
36
|
+
// out of request org scope. In that mode, keep the row unbound while
|
|
37
|
+
// still allowing the owner to persist the visibility preference.
|
|
38
|
+
if (!canKeepResourceUnscoped) {
|
|
39
|
+
throw new ForbiddenError(`${reg.displayName} cannot be shared with your organization because no active organization is selected.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Only the resource owner may bind an org to a previously unscoped resource.
|
|
44
|
+
// If a non-owner admin did this, the resource would adopt the admin's org
|
|
45
|
+
// and ownerMatchesActiveScope would then lock the real owner out of their
|
|
46
|
+
// own resource. Non-owner admins can still flip visibility once orgId is set.
|
|
47
|
+
if (access.role !== "owner") {
|
|
48
|
+
throw new ForbiddenError(`${reg.displayName} can only be attached to an organization by its owner.`);
|
|
49
|
+
}
|
|
50
|
+
update.orgId = currentOrgId;
|
|
51
|
+
}
|
|
39
52
|
}
|
|
53
|
+
const beforeExtensionTargets = await getExtensionShareChangeTargets(args.resourceType, args.resourceId);
|
|
40
54
|
await db
|
|
41
55
|
.update(reg.resourceTable)
|
|
42
56
|
.set(update)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-resource-visibility.js","sourceRoot":"","sources":["../../../src/sharing/actions/set-resource-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,cAAc,EACd,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,eAAe,YAAY,CAAC;IAC1B,WAAW,EACT,wOAAwO;IAC1O,sEAAsE;IACtE,oEAAoE;IACpE,YAAY,EAAE,KAAK;IACnB,MAAM,EAAE;QACN,cAAc,EAAE,IAAI;KACrB;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;KACjD,CAAC;IACF,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAClB,MAAM,GAAG,GAAG,wBAAwB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,GAAG,CAAC,WAAW,KAAK,KAAK,EAAE,CAAC;YAC9D,MAAM,IAAI,cAAc,CACtB,GAAG,GAAG,CAAC,WAAW,mFAAmF,CACtG,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,YAAY,CAC/B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,UAAU,EACf,OAAO,CACR,CAAC;QACF,MAAM,
|
|
1
|
+
{"version":3,"file":"set-resource-visibility.js","sourceRoot":"","sources":["../../../src/sharing/actions/set-resource-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK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AAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IACnD,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { eq } from \"drizzle-orm\";\nimport { z } from \"zod\";\nimport { defineAction } from \"../../action.js\";\nimport {\n assertAccess,\n currentAccess,\n ForbiddenError,\n resolveRegisteredAccessContext,\n} from \"../access.js\";\nimport { requireShareableResource } from \"../registry.js\";\nimport {\n getExtensionShareChangeTargets,\n notifyExtensionShareChanged,\n} from \"./extension-change.js\";\n\nexport default defineAction({\n description:\n \"Change the coarse visibility of a shareable resource: 'private' keeps it owner-only, 'org' shares it with all members of the owner's organization, 'public' makes it accessible to anyone with the link. Owner or admin role required.\",\n // (audit H5) Visibility changes are admin-tier and can flip a private\n // resource org-wide or public. Refuse from the tools iframe bridge.\n toolCallable: false,\n mcpApp: {\n compactCatalog: true,\n },\n schema: z.object({\n resourceType: z.string(),\n resourceId: z.string(),\n visibility: z.enum([\"private\", \"org\", \"public\"]),\n }),\n run: async (args) => {\n const reg = requireShareableResource(args.resourceType);\n if (args.visibility === \"public\" && reg.allowPublic === false) {\n throw new ForbiddenError(\n `${reg.displayName} cannot be made public — share with specific people or your organization instead.`,\n );\n }\n const access = await assertAccess(\n args.resourceType,\n args.resourceId,\n \"admin\",\n );\n const db = reg.getDb() as any;\n const update: Record<string, unknown> = { visibility: args.visibility };\n const rawAccess = currentAccess();\n const currentOrgId = resolveRegisteredAccessContext(reg, rawAccess).orgId;\n if (args.visibility === \"org\" && !access.resource?.orgId) {\n if (!currentOrgId) {\n const canKeepResourceUnscoped =\n !!rawAccess.orgId &&\n !!reg.resolveAccessContext &&\n access.role === \"owner\";\n // Some templates intentionally normalize local single-user resources\n // out of request org scope. In that mode, keep the row unbound while\n // still allowing the owner to persist the visibility preference.\n if (!canKeepResourceUnscoped) {\n throw new ForbiddenError(\n `${reg.displayName} cannot be shared with your organization because no active organization is selected.`,\n );\n }\n } else {\n // Only the resource owner may bind an org to a previously unscoped resource.\n // If a non-owner admin did this, the resource would adopt the admin's org\n // and ownerMatchesActiveScope would then lock the real owner out of their\n // own resource. Non-owner admins can still flip visibility once orgId is set.\n if (access.role !== \"owner\") {\n throw new ForbiddenError(\n `${reg.displayName} can only be attached to an organization by its owner.`,\n );\n }\n update.orgId = currentOrgId;\n }\n }\n const beforeExtensionTargets = await getExtensionShareChangeTargets(\n args.resourceType,\n args.resourceId,\n );\n await db\n .update(reg.resourceTable)\n .set(update)\n .where(eq(reg.resourceTable.id, args.resourceId));\n await notifyExtensionShareChanged(\n args.resourceType,\n args.resourceId,\n beforeExtensionTargets,\n );\n return { ok: true, visibility: args.visibility };\n },\n});\n"]}
|
|
@@ -258,16 +258,17 @@
|
|
|
258
258
|
min-height: 7.5rem;
|
|
259
259
|
border-radius: 1rem;
|
|
260
260
|
border-color: hsl(var(--border) / 0.75);
|
|
261
|
-
background: hsl(var(--
|
|
261
|
+
background: hsl(var(--muted) / 0.62);
|
|
262
262
|
box-shadow:
|
|
263
263
|
0 18px 55px hsl(var(--foreground) / 0.08),
|
|
264
264
|
0 1px 0 hsl(var(--foreground) / 0.04);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
.agent-composer-root--hero:focus-within {
|
|
268
|
+
border-color: hsl(var(--ring) / 0.9);
|
|
268
269
|
box-shadow:
|
|
269
270
|
0 20px 60px hsl(var(--foreground) / 0.1),
|
|
270
|
-
0
|
|
271
|
+
0 1px 0 hsl(var(--foreground) / 0.04);
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
.agent-composer-root--hero [data-agent-composer-slot="editor-wrap"] {
|
|
@@ -290,6 +291,118 @@
|
|
|
290
291
|
overflow: visible;
|
|
291
292
|
}
|
|
292
293
|
|
|
294
|
+
.agent-thinking-indicator {
|
|
295
|
+
display: inline-flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
min-height: 1.125rem;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.agent-thinking-indicator__glyph {
|
|
301
|
+
display: block;
|
|
302
|
+
width: var(--agent-thinking-width);
|
|
303
|
+
height: 1.125rem;
|
|
304
|
+
overflow: visible;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.agent-thinking-indicator__base {
|
|
308
|
+
fill: hsl(var(--muted-foreground) / 0.48);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.agent-thinking-indicator__shimmer {
|
|
312
|
+
transform-box: fill-box;
|
|
313
|
+
transform-origin: left center;
|
|
314
|
+
will-change: transform, opacity;
|
|
315
|
+
animation: agent-thinking-shimmer 1.7s cubic-bezier(0.42, 0, 0.18, 1) infinite;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.agent-thinking-indicator__sheen-edge {
|
|
319
|
+
stop-color: hsl(var(--foreground));
|
|
320
|
+
stop-opacity: 0;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.agent-thinking-indicator__sheen-mid {
|
|
324
|
+
stop-color: hsl(var(--foreground));
|
|
325
|
+
stop-opacity: 0.92;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.agent-thinking-indicator__ellipsis-dot {
|
|
329
|
+
opacity: 0;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.agent-thinking-indicator__ellipsis-dot--1 {
|
|
333
|
+
animation: agent-thinking-ellipsis-one 1.35s steps(1, end) infinite;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.agent-thinking-indicator__ellipsis-dot--2 {
|
|
337
|
+
animation: agent-thinking-ellipsis-two 1.35s steps(1, end) infinite;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.agent-thinking-indicator__ellipsis-dot--3 {
|
|
341
|
+
animation: agent-thinking-ellipsis-three 1.35s steps(1, end) infinite;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
@keyframes agent-thinking-shimmer {
|
|
345
|
+
0% {
|
|
346
|
+
opacity: 0;
|
|
347
|
+
transform: translateX(-118%);
|
|
348
|
+
}
|
|
349
|
+
22% {
|
|
350
|
+
opacity: 0.9;
|
|
351
|
+
}
|
|
352
|
+
62% {
|
|
353
|
+
opacity: 0.9;
|
|
354
|
+
}
|
|
355
|
+
100% {
|
|
356
|
+
opacity: 0;
|
|
357
|
+
transform: translateX(245%);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@keyframes agent-thinking-ellipsis-one {
|
|
362
|
+
0%,
|
|
363
|
+
24% {
|
|
364
|
+
opacity: 0;
|
|
365
|
+
}
|
|
366
|
+
25%,
|
|
367
|
+
100% {
|
|
368
|
+
opacity: 1;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
@keyframes agent-thinking-ellipsis-two {
|
|
373
|
+
0%,
|
|
374
|
+
49% {
|
|
375
|
+
opacity: 0;
|
|
376
|
+
}
|
|
377
|
+
50%,
|
|
378
|
+
100% {
|
|
379
|
+
opacity: 1;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@keyframes agent-thinking-ellipsis-three {
|
|
384
|
+
0%,
|
|
385
|
+
74% {
|
|
386
|
+
opacity: 0;
|
|
387
|
+
}
|
|
388
|
+
75%,
|
|
389
|
+
100% {
|
|
390
|
+
opacity: 1;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
@media (prefers-reduced-motion: reduce) {
|
|
395
|
+
.agent-thinking-indicator__shimmer {
|
|
396
|
+
animation: none;
|
|
397
|
+
opacity: 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.agent-thinking-indicator__ellipsis-dot {
|
|
401
|
+
animation: none;
|
|
402
|
+
opacity: 1;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
293
406
|
@media (prefers-reduced-motion: no-preference) {
|
|
294
407
|
@supports (view-transition-name: agent-native-chat) {
|
|
295
408
|
.agent-native-chat-view-transition {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-answer
|
|
3
|
+
description: >-
|
|
4
|
+
Answer code/product questions as visual Plan artifacts using repo, bridge, or
|
|
5
|
+
GitHub context; use for API specs, UI look, schema models, and architecture.
|
|
6
|
+
metadata:
|
|
7
|
+
visibility: exported
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Visual Answer
|
|
11
|
+
|
|
12
|
+
`/visual-answer` turns a specific code or product question into a published
|
|
13
|
+
Agent-Native Plan artifact. It is for questions that need a visual, inspectable
|
|
14
|
+
answer rather than a chat paragraph: API contracts, schema/data models, UI
|
|
15
|
+
states, component behavior, architecture flows, and code evidence.
|
|
16
|
+
|
|
17
|
+
## When To Use
|
|
18
|
+
|
|
19
|
+
Use this skill when the user asks:
|
|
20
|
+
|
|
21
|
+
- "what is the API spec for this?"
|
|
22
|
+
- "what does this UI look like?"
|
|
23
|
+
- "what is the schema model for x?"
|
|
24
|
+
- "draw the flow for this code path"
|
|
25
|
+
- "show me the current shape of this component/API/data model"
|
|
26
|
+
|
|
27
|
+
For history questions about what changed or shipped, search merged PR recaps
|
|
28
|
+
first with `search-pr-recaps`, then pull a relevant hit into the conversation
|
|
29
|
+
with `show-visual-plan` (it renders that plan or recap's blocks inline). Reach
|
|
30
|
+
for `get-visual-plan` only when you need the full bundle/MDX to edit, not to
|
|
31
|
+
display. Use `visual-answer` when the current codebase, a local bridge, or
|
|
32
|
+
GitHub source needs to be inspected to produce a new answer.
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
1. Inspect the real source first. Use the host agent's repo tools, the Plan
|
|
37
|
+
local bridge, or GitHub/source links. Do not invent endpoints, schema fields,
|
|
38
|
+
UI states, file names, or behavior.
|
|
39
|
+
2. Call `get-plan-blocks` before authoring. Use the live registry, not memory.
|
|
40
|
+
If the question asks what components are available, call
|
|
41
|
+
`list-plan-components`.
|
|
42
|
+
3. Pick the evidence blocks:
|
|
43
|
+
- API shape: `openapi-spec` plus `api-endpoint`; use before/after only when
|
|
44
|
+
comparing historical changes from recaps.
|
|
45
|
+
- UI look: `wireframe` or a `columns` before/after pair when comparing a
|
|
46
|
+
recap.
|
|
47
|
+
- Schema/data model: `data-model`, optionally with `diagram`.
|
|
48
|
+
- Code evidence: `file-tree`, `tabs`, `annotated-code`, and `diff` when the
|
|
49
|
+
answer depends on implementation details.
|
|
50
|
+
4. Publish with the Plan `visual-answer` action. Include the user's question,
|
|
51
|
+
`repoPath`/`sourceUrl` when known, a concise title/brief, and MDX source
|
|
52
|
+
under `mdx`.
|
|
53
|
+
5. In Agent-Native chat the published answer renders inline automatically — its
|
|
54
|
+
blocks appear in the conversation. Add a one-line summary of the evidence plus
|
|
55
|
+
the deep link; do not paste raw MDX or block source as text. (In terminal or
|
|
56
|
+
external MCP hosts that cannot render the blocks, return the URL.)
|
|
57
|
+
|
|
58
|
+
## Terminal Handoff
|
|
59
|
+
|
|
60
|
+
When running from a terminal or coding-agent shell, write
|
|
61
|
+
`visual-answer-source.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"question": "What is the billing API shape?",
|
|
66
|
+
"title": "Billing API visual answer",
|
|
67
|
+
"brief": "Shows the request and response contract.",
|
|
68
|
+
"repoPath": "owner/repo",
|
|
69
|
+
"sourceUrl": "https://github.com/owner/repo",
|
|
70
|
+
"mdx": {
|
|
71
|
+
"plan.mdx": "---\ntitle: Billing API visual answer\n---\n\n..."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then publish:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
agent-native plan visual-answer publish --question "What is the billing API shape?" --source visual-answer-source.json --repo owner/repo
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use `--source-url` for a GitHub file/PR/commit/issue URL, `--prev-plan-id` to
|
|
83
|
+
refresh an existing answer, and `--visibility private` for owner-only output.
|
|
84
|
+
The command writes `visual-answer-url.txt`.
|
|
85
|
+
|
|
86
|
+
## Don't
|
|
87
|
+
|
|
88
|
+
- Do not use `visual-answer` for a plain implementation plan; use
|
|
89
|
+
`visual-plan`.
|
|
90
|
+
- Do not use it for a PR diff recap; use `visual-recap`.
|
|
91
|
+
- Do not skip code inspection and infer from names alone.
|
|
92
|
+
- Do not publish screenshots, secrets, credential-looking values, or private
|
|
93
|
+
source excerpts beyond what the user has asked to visualize.
|
|
94
|
+
|
|
95
|
+
## Related Skills
|
|
96
|
+
|
|
97
|
+
- `visual-plan`
|
|
98
|
+
- `visual-recap`
|
|
99
|
+
- `delegate-to-agent`
|
|
100
|
+
- `context-awareness`
|
|
@@ -308,7 +308,7 @@ name: PR Visual Recap
|
|
|
308
308
|
|
|
309
309
|
on:
|
|
310
310
|
pull_request:
|
|
311
|
-
types: [opened, synchronize, reopened, ready_for_review]
|
|
311
|
+
types: [opened, synchronize, reopened, ready_for_review, closed]
|
|
312
312
|
|
|
313
313
|
jobs:
|
|
314
314
|
visual-recap:
|
|
@@ -360,7 +360,7 @@ The `cli-version` input controls which `@agent-native/core` CLI version runs ins
|
|
|
360
360
|
|
|
361
361
|
### workflow_call event context
|
|
362
362
|
|
|
363
|
-
`workflow_call` workflows inherit the **caller's** event context. The reusable workflow uses `github.event.pull_request.*` expressions to read the PR number, head SHA, base SHA, and PR metadata — these work correctly only when the caller triggers on `pull_request`. The caller snippet above already includes the correct event types.
|
|
363
|
+
`workflow_call` workflows inherit the **caller's** event context. The reusable workflow uses `github.event.pull_request.*` expressions to read the PR number, head SHA, base SHA, merge timestamp, and PR metadata — these work correctly only when the caller triggers on `pull_request`. The caller snippet above already includes the correct event types. The `closed` event is included so merged PR recaps can be stamped with `merged_at` and later searched as shipped work.
|
|
364
364
|
|
|
365
365
|
Do not trigger the caller on `workflow_dispatch` or `push` — those events do not carry a `pull_request` payload, and the gate will skip the recap with "no pull_request payload".
|
|
366
366
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -202,6 +202,7 @@
|
|
|
202
202
|
"@tiptap/starter-kit": "^3.26.0",
|
|
203
203
|
"@tiptap/y-tiptap": "^3.0.4",
|
|
204
204
|
"@uiw/react-codemirror": "^4.25.10",
|
|
205
|
+
"ajv": "^8.20.0",
|
|
205
206
|
"better-auth": "1.6.16",
|
|
206
207
|
"better-sqlite3": "^12.8.0",
|
|
207
208
|
"clsx": "^2.1.1",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-answer
|
|
3
|
+
description: >-
|
|
4
|
+
Answer code/product questions as visual Plan artifacts using repo, bridge, or
|
|
5
|
+
GitHub context; use for API specs, UI look, schema models, and architecture.
|
|
6
|
+
metadata:
|
|
7
|
+
visibility: exported
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Visual Answer
|
|
11
|
+
|
|
12
|
+
`/visual-answer` turns a specific code or product question into a published
|
|
13
|
+
Agent-Native Plan artifact. It is for questions that need a visual, inspectable
|
|
14
|
+
answer rather than a chat paragraph: API contracts, schema/data models, UI
|
|
15
|
+
states, component behavior, architecture flows, and code evidence.
|
|
16
|
+
|
|
17
|
+
## When To Use
|
|
18
|
+
|
|
19
|
+
Use this skill when the user asks:
|
|
20
|
+
|
|
21
|
+
- "what is the API spec for this?"
|
|
22
|
+
- "what does this UI look like?"
|
|
23
|
+
- "what is the schema model for x?"
|
|
24
|
+
- "draw the flow for this code path"
|
|
25
|
+
- "show me the current shape of this component/API/data model"
|
|
26
|
+
|
|
27
|
+
For history questions about what changed or shipped, search merged PR recaps
|
|
28
|
+
first with `search-pr-recaps`, then pull a relevant hit into the conversation
|
|
29
|
+
with `show-visual-plan` (it renders that plan or recap's blocks inline). Reach
|
|
30
|
+
for `get-visual-plan` only when you need the full bundle/MDX to edit, not to
|
|
31
|
+
display. Use `visual-answer` when the current codebase, a local bridge, or
|
|
32
|
+
GitHub source needs to be inspected to produce a new answer.
|
|
33
|
+
|
|
34
|
+
## Workflow
|
|
35
|
+
|
|
36
|
+
1. Inspect the real source first. Use the host agent's repo tools, the Plan
|
|
37
|
+
local bridge, or GitHub/source links. Do not invent endpoints, schema fields,
|
|
38
|
+
UI states, file names, or behavior.
|
|
39
|
+
2. Call `get-plan-blocks` before authoring. Use the live registry, not memory.
|
|
40
|
+
If the question asks what components are available, call
|
|
41
|
+
`list-plan-components`.
|
|
42
|
+
3. Pick the evidence blocks:
|
|
43
|
+
- API shape: `openapi-spec` plus `api-endpoint`; use before/after only when
|
|
44
|
+
comparing historical changes from recaps.
|
|
45
|
+
- UI look: `wireframe` or a `columns` before/after pair when comparing a
|
|
46
|
+
recap.
|
|
47
|
+
- Schema/data model: `data-model`, optionally with `diagram`.
|
|
48
|
+
- Code evidence: `file-tree`, `tabs`, `annotated-code`, and `diff` when the
|
|
49
|
+
answer depends on implementation details.
|
|
50
|
+
4. Publish with the Plan `visual-answer` action. Include the user's question,
|
|
51
|
+
`repoPath`/`sourceUrl` when known, a concise title/brief, and MDX source
|
|
52
|
+
under `mdx`.
|
|
53
|
+
5. In Agent-Native chat the published answer renders inline automatically — its
|
|
54
|
+
blocks appear in the conversation. Add a one-line summary of the evidence plus
|
|
55
|
+
the deep link; do not paste raw MDX or block source as text. (In terminal or
|
|
56
|
+
external MCP hosts that cannot render the blocks, return the URL.)
|
|
57
|
+
|
|
58
|
+
## Terminal Handoff
|
|
59
|
+
|
|
60
|
+
When running from a terminal or coding-agent shell, write
|
|
61
|
+
`visual-answer-source.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"question": "What is the billing API shape?",
|
|
66
|
+
"title": "Billing API visual answer",
|
|
67
|
+
"brief": "Shows the request and response contract.",
|
|
68
|
+
"repoPath": "owner/repo",
|
|
69
|
+
"sourceUrl": "https://github.com/owner/repo",
|
|
70
|
+
"mdx": {
|
|
71
|
+
"plan.mdx": "---\ntitle: Billing API visual answer\n---\n\n..."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then publish:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
agent-native plan visual-answer publish --question "What is the billing API shape?" --source visual-answer-source.json --repo owner/repo
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use `--source-url` for a GitHub file/PR/commit/issue URL, `--prev-plan-id` to
|
|
83
|
+
refresh an existing answer, and `--visibility private` for owner-only output.
|
|
84
|
+
The command writes `visual-answer-url.txt`.
|
|
85
|
+
|
|
86
|
+
## Don't
|
|
87
|
+
|
|
88
|
+
- Do not use `visual-answer` for a plain implementation plan; use
|
|
89
|
+
`visual-plan`.
|
|
90
|
+
- Do not use it for a PR diff recap; use `visual-recap`.
|
|
91
|
+
- Do not skip code inspection and infer from names alone.
|
|
92
|
+
- Do not publish screenshots, secrets, credential-looking values, or private
|
|
93
|
+
source excerpts beyond what the user has asked to visualize.
|
|
94
|
+
|
|
95
|
+
## Related Skills
|
|
96
|
+
|
|
97
|
+
- `visual-plan`
|
|
98
|
+
- `visual-recap`
|
|
99
|
+
- `delegate-to-agent`
|
|
100
|
+
- `context-awareness`
|