@agent-native/core 0.203.0 → 0.203.1-nightly-20261007183952

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.
Files changed (50) hide show
  1. package/dist/action.d.ts +34 -0
  2. package/dist/agent/clip-text.d.ts +4 -0
  3. package/dist/agent/clip-text.js +17 -0
  4. package/dist/agent/follow-up-suggestions.d.ts +16 -2
  5. package/dist/agent/follow-up-suggestions.js +69 -1
  6. package/dist/agent/production-agent.d.ts +20 -2
  7. package/dist/agent/production-agent.js +322 -132
  8. package/dist/agent/provider-model-selection.d.ts +21 -2
  9. package/dist/agent/provider-model-selection.js +19 -2
  10. package/dist/agent/run-loop-with-resume.js +2 -16
  11. package/dist/agent/tool-search.d.ts +31 -1
  12. package/dist/agent/tool-search.js +196 -15
  13. package/dist/agent/write-receipts.d.ts +27 -0
  14. package/dist/agent/write-receipts.js +181 -0
  15. package/dist/automation/index.d.ts +1 -1
  16. package/dist/collab/awareness.d.ts +2 -2
  17. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  18. package/dist/observability/routes.d.ts +6 -6
  19. package/dist/observability/trace-error.d.ts +5 -3
  20. package/dist/observability/trace-error.js +29 -4
  21. package/dist/observability/traces.js +6 -0
  22. package/dist/progress/routes.d.ts +1 -1
  23. package/dist/provider-api/actions/provider-api.d.ts +2 -2
  24. package/dist/resources/handlers.d.ts +1 -1
  25. package/dist/secrets/routes.d.ts +11 -11
  26. package/dist/server/action-routes.js +3 -0
  27. package/dist/server/agent-chat/prompt-resources.d.ts +13 -0
  28. package/dist/server/agent-chat/prompt-resources.js +21 -12
  29. package/dist/server/agent-chat-plugin.js +25 -9
  30. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  31. package/dist/server/agent-engine-default-model-route.d.ts +2 -2
  32. package/dist/server/email-auth-links.js +98 -2
  33. package/dist/server/embed-route.js +2 -1
  34. package/dist/server/index.d.ts +3 -3
  35. package/dist/server/index.js +3 -3
  36. package/dist/server/realtime-voice.js +2 -4
  37. package/dist/shared/embed-auth.d.ts +1 -0
  38. package/dist/shared/embed-auth.js +1 -0
  39. package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
  40. package/dist/templates/chat/.agents/skills/actions/SKILL.md +25 -0
  41. package/dist/templates/default/.agents/skills/actions/SKILL.md +25 -0
  42. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -39
  43. package/dist/templates/headless/.agents/skills/actions/SKILL.md +25 -0
  44. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +25 -0
  45. package/package.json +3 -3
  46. package/src/templates/chat/.agents/skills/actions/SKILL.md +25 -0
  47. package/src/templates/default/.agents/skills/actions/SKILL.md +25 -0
  48. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -39
  49. package/src/templates/headless/.agents/skills/actions/SKILL.md +25 -0
  50. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +25 -0
@@ -24,7 +24,7 @@ export { verifyCaptcha, type CaptchaVerifyResult } from "./captcha.js";
24
24
  export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, type LocaleInitScriptOptions, type ResolveLocaleFromRequestOptions, type ResolvedRequestLocale, } from "../localization/server.js";
25
25
  export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type DefaultAgentActionSurface, type AgentActionSurfaceResolution, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionItemMedia, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
26
26
  export type { AgentActionScope } from "../agent/types.js";
27
- export { actionsToEngineTools, executeAgentToolCall, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type JevContextCredentials, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
27
+ export { actionsToEngineTools, executeAgentToolCall, filterInitialEngineTools, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type JevContextCredentials, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
28
28
  export { isJevEnabled, requestJevThroughBuilder, type JevResponse, } from "../agent/jev-tool-prefetch.js";
29
29
  export { getRunStatus, getRunTurnRef } from "../agent/run-store.js";
30
30
  export { getActiveRunForThreadAsync } from "../agent/run-manager.js";
@@ -48,7 +48,7 @@ export { createContextXrayPlugin, defaultContextXrayPlugin, } from "../agent/con
48
48
  export { createObservationalMemoryPlugin, defaultObservationalMemoryPlugin, } from "../agent/observational-memory/plugin.js";
49
49
  export { createGoogleAuthPlugin, type GoogleAuthPluginOptions, } from "./google-auth-plugin.js";
50
50
  export type { GoogleAuthMode } from "./google-auth-mode.js";
51
- export { createAgentChatPlugin, defaultAgentChatPlugin, type AgentChatPluginOptions, } from "./agent-chat-plugin.js";
51
+ export { createAgentChatPlugin, defaultAgentChatPlugin, loadResourcesForPrompt, type AgentChatPluginOptions, } from "./agent-chat-plugin.js";
52
52
  export { refreshMcpManagerForPrincipal } from "./agent-chat/mcp-glue.js";
53
53
  export { AGENT_CHAT_STREAM_PATH, AGENT_CHAT_STREAM_TOKEN_SUFFIX, AGENT_CHAT_STREAM_TOKEN_TTL_SECONDS, createAgentChatStreamToken, isAgentChatStreamingRuntime, readAgentChatStreamBearerToken, verifyAgentChatStreamToken, type AgentChatStreamPrincipal, } from "./agent-chat-stream.js";
54
54
  export type { AgentChatMcpIcon, AgentChatMcpOptions, } from "./agent-chat/mcp-options.js";
@@ -77,7 +77,7 @@ export { extractBearerToken as extractInternalBearerToken, verifyInternalToken,
77
77
  export { autoDiscoverActions, autoDiscoverScripts, loadActionsFromStaticRegistry, mergeCoreSharingActions, registerPackageActions, } from "./action-discovery.js";
78
78
  export { attachToolSearch, createToolSearchEntry, searchToolRegistry, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
79
79
  export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools, FRAMEWORK_TOOL_GROUPS, type FrameworkToolGroup, type FrameworkToolsConfig, type FrameworkToolsOption, type ResolvedFrameworkTools, } from "../framework-tools.js";
80
- export { registerPromptContextProvider, type PromptContextProvider, type PromptContextProviderContext, type PromptContextProviderContribution, } from "./agent-chat/prompt-resources.js";
80
+ export { buildCompactSkillsSummary, registerPromptContextProvider, type PromptContextProvider, type PromptContextProviderContext, type PromptContextProviderContribution, } from "./agent-chat/prompt-resources.js";
81
81
  export { mountActionRoutes, type MountActionRoutesOptions, type ActionRouteAuthAdapter, type ActionRouteResolvedCaller, } from "./action-routes.js";
82
82
  export { AGENT_RUN_OWNER_CONTEXT_KEY, seedAgentRunOwnerContext, type AgentRunOwnerContext, } from "./agent-run-context.js";
83
83
  export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, type RequestContext, type RequestRunContext, } from "./request-context.js";
@@ -23,7 +23,7 @@ export { assertCurrentRequestUserIsOrgAdmin, currentRequestUserIsOrgAdmin, } fro
23
23
  export { verifyCaptcha } from "./captcha.js";
24
24
  export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, } from "../localization/server.js";
25
25
  export { createProductionAgentHandler, } from "../agent/index.js";
26
- export { actionsToEngineTools, executeAgentToolCall, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, } from "../agent/production-agent.js";
26
+ export { actionsToEngineTools, executeAgentToolCall, filterInitialEngineTools, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, } from "../agent/production-agent.js";
27
27
  export { isJevEnabled, requestJevThroughBuilder, } from "../agent/jev-tool-prefetch.js";
28
28
  export { getRunStatus, getRunTurnRef } from "../agent/run-store.js";
29
29
  export { getActiveRunForThreadAsync } from "../agent/run-manager.js";
@@ -46,7 +46,7 @@ export { createExperimentsPlugin } from "../experiments/server.js";
46
46
  export { createContextXrayPlugin, defaultContextXrayPlugin, } from "../agent/context-xray/plugin.js";
47
47
  export { createObservationalMemoryPlugin, defaultObservationalMemoryPlugin, } from "../agent/observational-memory/plugin.js";
48
48
  export { createGoogleAuthPlugin, } from "./google-auth-plugin.js";
49
- export { createAgentChatPlugin, defaultAgentChatPlugin, } from "./agent-chat-plugin.js";
49
+ export { createAgentChatPlugin, defaultAgentChatPlugin, loadResourcesForPrompt, } from "./agent-chat-plugin.js";
50
50
  export { refreshMcpManagerForPrincipal } from "./agent-chat/mcp-glue.js";
51
51
  export { AGENT_CHAT_STREAM_PATH, AGENT_CHAT_STREAM_TOKEN_SUFFIX, AGENT_CHAT_STREAM_TOKEN_TTL_SECONDS, createAgentChatStreamToken, isAgentChatStreamingRuntime, readAgentChatStreamBearerToken, verifyAgentChatStreamToken, } from "./agent-chat-stream.js";
52
52
  export { configureAgentNativeEmbeddedEnvironment, createAgentNativeEmbeddedAuthOptions, createAgentNativeEmbeddedPlugin, mountAgentNativeEmbedded, normalizeAgentNativeEmbeddedSession, } from "./embedded.js";
@@ -72,7 +72,7 @@ export { extractBearerToken as extractInternalBearerToken, verifyInternalToken,
72
72
  export { autoDiscoverActions, autoDiscoverScripts, loadActionsFromStaticRegistry, mergeCoreSharingActions, registerPackageActions, } from "./action-discovery.js";
73
73
  export { attachToolSearch, createToolSearchEntry, searchToolRegistry, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
74
74
  export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools, FRAMEWORK_TOOL_GROUPS, } from "../framework-tools.js";
75
- export { registerPromptContextProvider, } from "./agent-chat/prompt-resources.js";
75
+ export { buildCompactSkillsSummary, registerPromptContextProvider, } from "./agent-chat/prompt-resources.js";
76
76
  export { mountActionRoutes, } from "./action-routes.js";
77
77
  export { AGENT_RUN_OWNER_CONTEXT_KEY, seedAgentRunOwnerContext, } from "./agent-run-context.js";
78
78
  export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, } from "./request-context.js";
@@ -2,7 +2,7 @@ import { defineEventHandler, getHeader, getMethod, readRawBody, setResponseHeade
2
2
  import { getBuilderGatewayRequestHeaders } from "../agent/engine/builder-gateway-headers.js";
3
3
  import { actionsToEngineTools, } from "../agent/production-agent.js";
4
4
  import { redactSensitiveFields, sanitizeToolErrorText, sanitizeToolErrorValue, } from "../agent/tool-error-redaction.js";
5
- import { TOOL_SEARCH_ACTION_NAME } from "../agent/tool-search.js";
5
+ import { isTargetedToolSearch, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
6
6
  import { parseAcceptLanguage } from "../localization/server.js";
7
7
  import { getSession } from "./auth.js";
8
8
  import { gatewayLaneUnavailableMessage, getBuilderGatewayBaseUrl, resolveBuilderGatewayAuth, resolveSecret, } from "./credential-provider.js";
@@ -275,11 +275,9 @@ function parseSuccessfulToolSearchNames(output) {
275
275
  }
276
276
  }
277
277
  function grantDiscoveredRealtimeTools(input) {
278
- const query = input.request.args.query;
279
278
  if (input.request.name !== TOOL_SEARCH_ACTION_NAME ||
280
279
  input.result.status !== "completed" ||
281
- typeof query !== "string" ||
282
- !query.trim()) {
280
+ !isTargetedToolSearch(input.request.args)) {
283
281
  return [];
284
282
  }
285
283
  const candidates = parseSuccessfulToolSearchNames(input.result.output)
@@ -3,6 +3,7 @@ export declare const EMBED_TOKEN_QUERY_PARAM = "__an_embed_token";
3
3
  export declare const EMBED_TARGET_QUERY_PARAM = "__an_embed_target";
4
4
  export declare const EMBED_MODE_QUERY_PARAM = "embedded";
5
5
  export declare const MCP_APP_CHAT_BRIDGE_QUERY_PARAM = "__an_mcp_chat_bridge";
6
+ export declare const MCP_DIRECTORY_WIDGET_QUERY_PARAM = "__an_mcp_directory_widget";
6
7
  export declare const EMBED_SESSION_COOKIE = "an_embed_session";
7
8
  export declare const EMBED_TARGET_HEADER = "x-agent-native-embed-target";
8
9
  export declare const MCP_DIRECTORY_WIDGET_READ_CAPABILITY_PREFIX = "capability:mcp-directory-widget-read:";
@@ -3,6 +3,7 @@ export const EMBED_TOKEN_QUERY_PARAM = "__an_embed_token";
3
3
  export const EMBED_TARGET_QUERY_PARAM = "__an_embed_target";
4
4
  export const EMBED_MODE_QUERY_PARAM = "embedded";
5
5
  export const MCP_APP_CHAT_BRIDGE_QUERY_PARAM = "__an_mcp_chat_bridge";
6
+ export const MCP_DIRECTORY_WIDGET_QUERY_PARAM = "__an_mcp_directory_widget";
6
7
  export const EMBED_SESSION_COOKIE = "an_embed_session";
7
8
  export const EMBED_TARGET_HEADER = "x-agent-native-embed-target";
8
9
  export const MCP_DIRECTORY_WIDGET_READ_CAPABILITY_PREFIX = "capability:mcp-directory-widget-read:";
@@ -2,6 +2,7 @@ declare const _default: import("../../action.js").ActionDefinition<{
2
2
  resourceType: string;
3
3
  resourceId: string;
4
4
  }, {
5
+ role?: undefined;
5
6
  ownerEmail: any;
6
7
  visibility: any;
7
8
  shares: any[];
@@ -11,7 +12,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
11
12
  supportsGroupShares?: boolean;
12
13
  };
13
14
  orgId?: undefined;
14
- role?: undefined;
15
15
  agentReadable?: undefined;
16
16
  } | {
17
17
  ownerEmail: string;
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: review-latest-feedback
3
3
  description: >-
4
- Sweep Slack, GitHub, Sentry, Analytics, trackers, and automated diagnostics,
5
- plus app/template, desktop, and package deploy/release/publish lanes. Fix
6
- verified defects, verify recovery targets, and recap. Use for scheduled or
7
- manual sweeps.
4
+ Review Slack, GitHub, CI, Sentry, Analytics, diagnostics, linked trackers,
5
+ and app/template, desktop, and package deploy/release lanes. Answer reporters
6
+ first; fix verified defects, verify delivery, build upvoted features, and
7
+ recap. Use for scheduled or manual sweeps.
8
8
  user-invocable: true
9
9
  scope: dev
10
10
  metadata:
@@ -218,15 +218,9 @@ Phase 2 reapplies these rules after full-thread review.
218
218
  Use `## Slack channels` unless the invocation narrows scope.
219
219
 
220
220
  **Automated diagnostics are feedback.** For Slack, gate before reading.
221
- Before investigating, use only alert and linked issue/PR/run/task metadata to
222
- identify repo/ref/SHA, workflow/service/environment, failure fingerprint, and
223
- active same-failure owner; this is Phase 0's sole pre-claim exception. If
224
- unowned/in scope, claim: Slack `👀`; elsewhere, current-task status row with
225
- source permalink, fingerprint, owner task/worktree, next action. Continue if
226
- this task owns it; else record **Owned elsewhere** (owner/link/action) and
227
- stop. No logs/tests/artifacts before claim. The required Slack claim reaction
228
- is authorized here; other source mutations need exact authorization. Then read
229
- `references/automated-diagnostics.md`.
221
+ Before claiming, use only alert/link metadata. Follow
222
+ [`automated-diagnostics.md`](references/automated-diagnostics.md) for ownership,
223
+ claim, and stop/continue; inspect logs, tests, and artifacts only afterward.
230
224
 
231
225
  **Defects and design feedback.** A clear bug has observable broken behavior: a
232
226
  click or submit does nothing, an action errors, data is lost or reverted, the
@@ -271,13 +265,12 @@ the query also returns ordinary replies and old polls that happen to carry the
271
265
  reaction. Take the ones that name a concrete improvement; skip the rest
272
266
  without comment.
273
267
 
274
- An upvoted item is a **feature or UX change**: it skips only the clear-bug bar,
275
- not `👀`, fix-altitude, verification, or question-budget requirements. The
276
- upvote overrides the bug gate, not ownership; build the smallest endorsed
277
- version and name Sid or Alice in the recap. Add `👀` before investigation or
278
- delegation and read it back. Keep an evidence-limited disposition until Phase
279
- 2's four bars hold; then use **Shipped**, adding `✅` only if it also meets
280
- **Fixed**.
268
+ An upvote endorses a **feature or UX change** and skips only the clear-bug bar;
269
+ it does not change ownership, reaction, verification, or question-budget rules.
270
+ Build the smallest endorsed version, name Sid or Alice, and state requested
271
+ versus actual behavior in the recap. Add `👀` before investigation or
272
+ delegation and read it back. Keep it evidence-limited until Phase 2's four bars
273
+ hold; then use **Shipped**, adding `✅` only if it meets **Fixed**.
281
274
 
282
275
  Don't search `has::eyes:`; use the owner or handoff path above.
283
276
 
@@ -326,13 +319,15 @@ inventing a fix.
326
319
 
327
320
  ### Deployment, release, and publish failures
328
321
 
329
- Scan app/template, desktop build/release, and package-publish lanes on every
330
- sweep, even without a linked report. Include queued/running runs, run-only
331
- failures, and missing/stale artifacts; carry active run IDs and rows across
332
- cursors. Fix verified repo-owned causes; record external/manual causes with the
333
- next owner/action. Use [`deployment-recovery.md`](references/deployment-recovery.md)
334
- for lane-specific recovery and target proof. Green CI or merged source
335
- does not prove delivery.
322
+ Scan app/template, desktop, and package lanes every sweep, even without linked
323
+ feedback. Carry active run IDs, queued/running runs, failures, and missing/stale
324
+ artifacts across cursors. Fix repo causes; record external/manual causes with
325
+ the next owner/action. CI-red deploy rows from [CI triage](references/ci-red-report.md)
326
+ reuse this operational fingerprint. Follow
327
+ [`deployment-recovery.md`](references/deployment-recovery.md) for recovery and
328
+ target proof; keep delivery active until proof passes. A source issue may be
329
+ **Fixed** separately; delivery gaps are never **Quarantined**. Green CI or
330
+ merged source does not prove delivery.
336
331
 
337
332
  ## Phase 2: fix
338
333
 
@@ -363,8 +358,7 @@ slack_search: <2-4 distinctive symptom words> in:<#CHANNEL>
363
358
  ```
364
359
 
365
360
  Search in the reporter's words — `zoom invalid_client`, `logout twice` — not
366
- your diagnosis. People describe one bug differently, so read the hits rather
367
- than trusting the count.
361
+ your diagnosis. Read hits; one bug may have different descriptions.
368
362
 
369
363
  **A repeat report after a Fixed claim is evidence that fix failed.** It is the
370
364
  only falsification signal this workflow gets, and it outranks your belief that
@@ -435,10 +429,9 @@ pre-existing.
435
429
  ### Npx and package reports have a release follow-up
436
430
 
437
431
  Use [`deployment-recovery.md`](references/deployment-recovery.md) for npx
438
- version evidence, registry proof, publication status, and existing-app upgrade
439
- verification. A verified merge may be **Fixed** under the issue-closure rule
440
- above while its delivery row stays open; a local scaffold or beta promise is not
441
- delivery.
432
+ version, registry, publication, and existing-app upgrade proof. A verified merge
433
+ may be **Fixed** while its delivery row stays open; a local scaffold or beta
434
+ promise is not delivery.
442
435
 
443
436
  ### Documentation has a runnable proof obligation
444
437
 
@@ -457,12 +450,6 @@ Never hard-code a rule for the wording of one report. One data point justifies
457
450
  a local regression test or a contained fix; it never justifies a global agent
458
451
  instruction or prompt exception.
459
452
 
460
- ### The bar for saying "Fixed"
461
-
462
- Phase 2 defines the proof bars for **Fixed**, **Shipped**, and
463
- **Live verified**. Upvoted improvements state requested versus actual behavior
464
- and use **Shipped**.
465
-
466
453
  ## Phase 3: reply
467
454
 
468
455
  Thank issue reporters for opening it and Slack reporters for sharing. Give the
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.203.0",
3
+ "version": "0.203.1-nightly-20261007183952",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -682,7 +682,7 @@
682
682
  "yaml": "^2.9.0",
683
683
  "yjs": "^13.6.33",
684
684
  "zod": "^4.3.6",
685
- "@agent-native/agentkit": "^0.203.0",
685
+ "@agent-native/agentkit": "^0.203.1-nightly-20261007183952",
686
686
  "@agent-native/recap-cli": "^0.5.64"
687
687
  },
688
688
  "devDependencies": {
@@ -753,7 +753,7 @@
753
753
  "xlsx": "^0.18.5"
754
754
  },
755
755
  "peerDependencies": {
756
- "@agent-native/core-corpus": ">=0.196.0",
756
+ "@agent-native/core-corpus": "0.203.1-nightly-20261007183952",
757
757
  "@ai-sdk/anthropic": ">=3",
758
758
  "@ai-sdk/cohere": ">=3",
759
759
  "@ai-sdk/google": ">=3",
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: review-latest-feedback
3
3
  description: >-
4
- Sweep Slack, GitHub, Sentry, Analytics, trackers, and automated diagnostics,
5
- plus app/template, desktop, and package deploy/release/publish lanes. Fix
6
- verified defects, verify recovery targets, and recap. Use for scheduled or
7
- manual sweeps.
4
+ Review Slack, GitHub, CI, Sentry, Analytics, diagnostics, linked trackers,
5
+ and app/template, desktop, and package deploy/release lanes. Answer reporters
6
+ first; fix verified defects, verify delivery, build upvoted features, and
7
+ recap. Use for scheduled or manual sweeps.
8
8
  user-invocable: true
9
9
  scope: dev
10
10
  metadata:
@@ -218,15 +218,9 @@ Phase 2 reapplies these rules after full-thread review.
218
218
  Use `## Slack channels` unless the invocation narrows scope.
219
219
 
220
220
  **Automated diagnostics are feedback.** For Slack, gate before reading.
221
- Before investigating, use only alert and linked issue/PR/run/task metadata to
222
- identify repo/ref/SHA, workflow/service/environment, failure fingerprint, and
223
- active same-failure owner; this is Phase 0's sole pre-claim exception. If
224
- unowned/in scope, claim: Slack `👀`; elsewhere, current-task status row with
225
- source permalink, fingerprint, owner task/worktree, next action. Continue if
226
- this task owns it; else record **Owned elsewhere** (owner/link/action) and
227
- stop. No logs/tests/artifacts before claim. The required Slack claim reaction
228
- is authorized here; other source mutations need exact authorization. Then read
229
- `references/automated-diagnostics.md`.
221
+ Before claiming, use only alert/link metadata. Follow
222
+ [`automated-diagnostics.md`](references/automated-diagnostics.md) for ownership,
223
+ claim, and stop/continue; inspect logs, tests, and artifacts only afterward.
230
224
 
231
225
  **Defects and design feedback.** A clear bug has observable broken behavior: a
232
226
  click or submit does nothing, an action errors, data is lost or reverted, the
@@ -271,13 +265,12 @@ the query also returns ordinary replies and old polls that happen to carry the
271
265
  reaction. Take the ones that name a concrete improvement; skip the rest
272
266
  without comment.
273
267
 
274
- An upvoted item is a **feature or UX change**: it skips only the clear-bug bar,
275
- not `👀`, fix-altitude, verification, or question-budget requirements. The
276
- upvote overrides the bug gate, not ownership; build the smallest endorsed
277
- version and name Sid or Alice in the recap. Add `👀` before investigation or
278
- delegation and read it back. Keep an evidence-limited disposition until Phase
279
- 2's four bars hold; then use **Shipped**, adding `✅` only if it also meets
280
- **Fixed**.
268
+ An upvote endorses a **feature or UX change** and skips only the clear-bug bar;
269
+ it does not change ownership, reaction, verification, or question-budget rules.
270
+ Build the smallest endorsed version, name Sid or Alice, and state requested
271
+ versus actual behavior in the recap. Add `👀` before investigation or
272
+ delegation and read it back. Keep it evidence-limited until Phase 2's four bars
273
+ hold; then use **Shipped**, adding `✅` only if it meets **Fixed**.
281
274
 
282
275
  Don't search `has::eyes:`; use the owner or handoff path above.
283
276
 
@@ -326,13 +319,15 @@ inventing a fix.
326
319
 
327
320
  ### Deployment, release, and publish failures
328
321
 
329
- Scan app/template, desktop build/release, and package-publish lanes on every
330
- sweep, even without a linked report. Include queued/running runs, run-only
331
- failures, and missing/stale artifacts; carry active run IDs and rows across
332
- cursors. Fix verified repo-owned causes; record external/manual causes with the
333
- next owner/action. Use [`deployment-recovery.md`](references/deployment-recovery.md)
334
- for lane-specific recovery and target proof. Green CI or merged source
335
- does not prove delivery.
322
+ Scan app/template, desktop, and package lanes every sweep, even without linked
323
+ feedback. Carry active run IDs, queued/running runs, failures, and missing/stale
324
+ artifacts across cursors. Fix repo causes; record external/manual causes with
325
+ the next owner/action. CI-red deploy rows from [CI triage](references/ci-red-report.md)
326
+ reuse this operational fingerprint. Follow
327
+ [`deployment-recovery.md`](references/deployment-recovery.md) for recovery and
328
+ target proof; keep delivery active until proof passes. A source issue may be
329
+ **Fixed** separately; delivery gaps are never **Quarantined**. Green CI or
330
+ merged source does not prove delivery.
336
331
 
337
332
  ## Phase 2: fix
338
333
 
@@ -363,8 +358,7 @@ slack_search: <2-4 distinctive symptom words> in:<#CHANNEL>
363
358
  ```
364
359
 
365
360
  Search in the reporter's words — `zoom invalid_client`, `logout twice` — not
366
- your diagnosis. People describe one bug differently, so read the hits rather
367
- than trusting the count.
361
+ your diagnosis. Read hits; one bug may have different descriptions.
368
362
 
369
363
  **A repeat report after a Fixed claim is evidence that fix failed.** It is the
370
364
  only falsification signal this workflow gets, and it outranks your belief that
@@ -435,10 +429,9 @@ pre-existing.
435
429
  ### Npx and package reports have a release follow-up
436
430
 
437
431
  Use [`deployment-recovery.md`](references/deployment-recovery.md) for npx
438
- version evidence, registry proof, publication status, and existing-app upgrade
439
- verification. A verified merge may be **Fixed** under the issue-closure rule
440
- above while its delivery row stays open; a local scaffold or beta promise is not
441
- delivery.
432
+ version, registry, publication, and existing-app upgrade proof. A verified merge
433
+ may be **Fixed** while its delivery row stays open; a local scaffold or beta
434
+ promise is not delivery.
442
435
 
443
436
  ### Documentation has a runnable proof obligation
444
437
 
@@ -457,12 +450,6 @@ Never hard-code a rule for the wording of one report. One data point justifies
457
450
  a local regression test or a contained fix; it never justifies a global agent
458
451
  instruction or prompt exception.
459
452
 
460
- ### The bar for saying "Fixed"
461
-
462
- Phase 2 defines the proof bars for **Fixed**, **Shipped**, and
463
- **Live verified**. Upvoted improvements state requested versus actual behavior
464
- and use **Shipped**.
465
-
466
453
  ## Phase 3: reply
467
454
 
468
455
  Thank issue reporters for opening it and Slack reporters for sharing. Give the
@@ -107,6 +107,31 @@ An action that hands control back to the user (question form, intake dialog) set
107
107
 
108
108
  Reach for `outputSchema` (validate the return), `_agentImages` (attach images the agent can see), `authorize` (gate who may call it), or `needsApproval` (require human sign-off per call) only when the action needs that guarantee — examples in `references/action-fields.md`.
109
109
 
110
+ ### Write receipts
111
+
112
+ A write action that can check its own effect returns a plain-object result with a reserved `_receipt`, so the final answer is reconciled with what the write did, not with the model's reading of a JSON string that may be truncated:
113
+
114
+ ```ts
115
+ import type { WriteReceipt } from "@agent-native/core/action";
116
+
117
+ const _receipt: WriteReceipt = {
118
+ changed: true,
119
+ verified: false,
120
+ summary: "Saved; panel 3 returned no rows.",
121
+ checks: [{ id: "panel-3", ok: false, detail: "0 rows" }],
122
+ };
123
+ return { id, _receipt };
124
+ ```
125
+
126
+ `verified` is `true` (the effect was observed), `false` (checked and did not hold), or `"unverified"` (could not be checked); `checks` and `warnings` are optional. The agent loop reads the receipt before the result is stringified and truncated (summary 200 chars, 8 checks, 5 warnings):
127
+
128
+ - `verified: false` or `changed: false` forces one honest-reconciliation retry per turn: the model must say what the receipt shows and may not call the change visible or working. If the retry is spent, the answer is prefixed with the receipt block.
129
+ - `verified: "unverified"` only prefixes that note; no retry.
130
+ - A receipt that is present but malformed counts as `unverified`, never clean. `changed: false` also records the call as `completedSideEffect: false`.
131
+ - Set `subject` (the stable target, such as a dashboard id) so a later `changed: true, verified: true` receipt for the same subject can supersede an earlier flagged one in the same turn. When the earlier receipt had failing or unverified `checks`, the later receipts (from this action or another that writes the same subject) must carry an `ok: true` check with the same `id` for each; a receipt without checks never clears one that had them. A flagged receipt with no failing checks is superseded only by the same action. Receipts without a `subject` are never superseded.
132
+
133
+ A receipt is not an error channel. A write that did not achieve the requested state throws (`fail()`); return `changed: false` only for a benign no-op, such as the record already being in the requested state.
134
+
110
135
  ## Frontend Hooks
111
136
 
112
137
  Import from focused `@agent-native/core/client/*` entry points; the broad