@noodleseed/one 0.174.0 → 0.175.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.
Files changed (162) hide show
  1. package/dist/commands/solutions-activity.js +1 -1
  2. package/dist/commands/solutions-activity.js.map +1 -1
  3. package/dist/commands/solutions-drafts.d.ts.map +1 -1
  4. package/dist/commands/solutions-drafts.js +36 -9
  5. package/dist/commands/solutions-drafts.js.map +1 -1
  6. package/dist/commands/solutions-native-lifecycle.d.ts +5 -0
  7. package/dist/commands/solutions-native-lifecycle.d.ts.map +1 -0
  8. package/dist/commands/solutions-native-lifecycle.js +77 -0
  9. package/dist/commands/solutions-native-lifecycle.js.map +1 -0
  10. package/dist/commands/solutions-ops.d.ts.map +1 -1
  11. package/dist/commands/solutions-ops.js +3 -0
  12. package/dist/commands/solutions-ops.js.map +1 -1
  13. package/dist/commands/solutions-workspace.d.ts.map +1 -1
  14. package/dist/commands/solutions-workspace.js +36 -11
  15. package/dist/commands/solutions-workspace.js.map +1 -1
  16. package/dist/commands/whatsapp-output.d.ts.map +1 -1
  17. package/dist/commands/whatsapp-output.js +20 -4
  18. package/dist/commands/whatsapp-output.js.map +1 -1
  19. package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.d.ts +16 -9
  20. package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.js +5 -2
  21. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +9 -0
  22. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +5 -5
  23. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +9 -0
  24. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +1 -1
  25. package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +13 -1
  26. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  27. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.d.ts +5 -3
  28. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-coordinator.js +5 -4
  29. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-inbox.js +6 -2
  30. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-store.d.ts +1 -1
  31. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-types.d.ts +12 -0
  32. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-work.d.ts +7 -2
  33. package/node_modules/@noodle-borg/assistant-gateway/dist/channel-work.js +14 -4
  34. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-capture.js +104 -0
  35. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-judgment.js +93 -0
  36. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-ledger.d.ts +105 -0
  37. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-ledger.js +183 -0
  38. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-model-call.js +38 -0
  39. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-parsers.d.ts +22 -0
  40. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-parsers.js +109 -0
  41. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-review.d.ts +21 -0
  42. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-review.js +44 -0
  43. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-spec.d.ts +18 -0
  44. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-spec.js +86 -0
  45. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-store.d.ts +11 -0
  46. package/node_modules/@noodle-borg/assistant-gateway/dist/collection-store.js +18 -0
  47. package/node_modules/@noodle-borg/assistant-gateway/dist/messaging-tool-dispatch.d.ts +20 -1
  48. package/node_modules/@noodle-borg/assistant-gateway/dist/messaging-tool-dispatch.js +38 -2
  49. package/node_modules/@noodle-borg/assistant-gateway/dist/model-runtime.js +3 -0
  50. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.d.ts +5 -0
  51. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.js +5 -0
  52. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +1 -0
  53. package/node_modules/@noodle-borg/authoring/dist/interaction.d.ts +49 -0
  54. package/node_modules/@noodle-borg/authoring/dist/interaction.js +25 -0
  55. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -0
  56. package/node_modules/@noodle-borg/authoring/dist/server.js +4 -0
  57. package/node_modules/@noodle-borg/authoring/package.json +6 -1
  58. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-channels.js +1 -1
  59. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-drafts.js +7 -0
  60. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-native-lifecycle.js +43 -0
  61. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-records.js +154 -0
  62. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solution-workspace.js +8 -1
  63. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +2 -149
  64. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +2 -1
  65. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +33 -0
  66. package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +2 -1
  67. package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +2 -1
  68. package/node_modules/@noodle-borg/compiler/dist/compile.js +5 -0
  69. package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
  70. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +2 -2
  71. package/node_modules/@noodle-borg/compiler/dist/index.js +1 -1
  72. package/node_modules/@noodle-borg/compiler/dist/manifest/interaction-schema.d.ts +41 -0
  73. package/node_modules/@noodle-borg/compiler/dist/manifest/interaction-schema.js +62 -0
  74. package/node_modules/@noodle-borg/compiler/dist/manifest/interaction-validation.js +220 -0
  75. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +60 -4
  76. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +7 -1
  77. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.d.ts +9 -1
  78. package/node_modules/@noodle-borg/compiler/dist/manifest/website-projection.js +58 -10
  79. package/node_modules/@noodle-borg/control-plane/dist/in-memory-atomic-state.d.ts +8 -0
  80. package/node_modules/@noodle-borg/control-plane/dist/in-memory-atomic-state.js +136 -0
  81. package/node_modules/@noodle-borg/control-plane/dist/in-memory-control-plane-store.d.ts +7 -0
  82. package/node_modules/@noodle-borg/control-plane/dist/in-memory-control-plane-store.js +16 -24
  83. package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.d.ts +4 -2
  84. package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.js +8 -6
  85. package/node_modules/@noodle-borg/control-plane/dist/mcp-subdomain-claims.d.ts +2 -1
  86. package/node_modules/@noodle-borg/control-plane/dist/mcp-subdomain-claims.js +13 -8
  87. package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.d.ts +13 -4
  88. package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.js +23 -7
  89. package/node_modules/@noodle-borg/control-plane/dist/portable.d.ts +2 -1
  90. package/node_modules/@noodle-borg/control-plane/dist/portable.js +1 -0
  91. package/node_modules/@noodle-borg/module/dist/platform-human-identity.d.ts +5 -2
  92. package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +16 -4
  93. package/node_modules/@noodle-borg/runtime/dist/execute.d.ts +3 -6
  94. package/node_modules/@noodle-borg/runtime/dist/index.d.ts +1 -1
  95. package/node_modules/@noodle-borg/service/dist/application-activity.js +85 -63
  96. package/node_modules/@noodle-borg/service/dist/application-drafts/contracts.js +9 -0
  97. package/node_modules/@noodle-borg/service/dist/application-drafts/paths.js +2 -2
  98. package/node_modules/@noodle-borg/service/dist/application-runtime-target.js +1 -1
  99. package/node_modules/@noodle-borg/service/dist/business-information/contracts.d.ts +18 -4
  100. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-business-pages.js +3 -5
  101. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-installation-lifecycle.js +8 -6
  102. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-native-lifecycle.js +80 -0
  103. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +27 -31
  104. package/node_modules/@noodle-borg/service/dist/business-information/memory-native-retention.js +29 -0
  105. package/node_modules/@noodle-borg/service/dist/business-information/model.js +9 -2
  106. package/node_modules/@noodle-borg/service/dist/business-information/native-query.js +3 -1
  107. package/node_modules/@noodle-borg/service/dist/business-information/native-record-lifecycle.d.ts +27 -0
  108. package/node_modules/@noodle-borg/service/dist/business-information/native-record-lifecycle.js +63 -0
  109. package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.d.ts +3 -1
  110. package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.js +9 -4
  111. package/node_modules/@noodle-borg/service/dist/business-information/staff-authority.d.ts +16 -0
  112. package/node_modules/@noodle-borg/service/dist/business-information/staff-authority.js +60 -0
  113. package/node_modules/@noodle-borg/service/dist/business-information/workspace-permissions.js +18 -0
  114. package/node_modules/@noodle-borg/service/dist/business-information-runtime.js +1 -0
  115. package/node_modules/@noodle-borg/service/dist/business-onboarding.js +16 -3
  116. package/node_modules/@noodle-borg/service/dist/business-workspaces/contracts.d.ts +110 -0
  117. package/node_modules/@noodle-borg/service/dist/business-workspaces/permissions.d.ts +7 -0
  118. package/node_modules/@noodle-borg/service/dist/business-workspaces/store.d.ts +102 -0
  119. package/node_modules/@noodle-borg/service/dist/channels/360dialog.js +70 -8
  120. package/node_modules/@noodle-borg/service/dist/channels/capability-report.js +73 -0
  121. package/node_modules/@noodle-borg/service/dist/channels/collection-turn.js +232 -0
  122. package/node_modules/@noodle-borg/service/dist/channels/composition.js +1 -0
  123. package/node_modules/@noodle-borg/service/dist/channels/messaging-eligibility.js +45 -0
  124. package/node_modules/@noodle-borg/service/dist/channels/reply-buttons.js +23 -0
  125. package/node_modules/@noodle-borg/service/dist/channels/runtime.js +127 -33
  126. package/node_modules/@noodle-borg/service/dist/native-record-connector.js +19 -4
  127. package/node_modules/@noodle-borg/service/dist/routes/application-drafts.js +44 -2
  128. package/node_modules/@noodle-borg/service/dist/routes/assistant-agent.js +4 -0
  129. package/node_modules/@noodle-borg/service/dist/routes/business-authoring-dispatch.js +1 -1
  130. package/node_modules/@noodle-borg/service/dist/routes/business-information-access.js +39 -0
  131. package/node_modules/@noodle-borg/service/dist/routes/business-information-activity.js +1 -1
  132. package/node_modules/@noodle-borg/service/dist/routes/business-information-channels.js +2 -2
  133. package/node_modules/@noodle-borg/service/dist/routes/business-information-connections.js +10 -4
  134. package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +11 -0
  135. package/node_modules/@noodle-borg/service/dist/routes/business-information-installation.js +3 -1
  136. package/node_modules/@noodle-borg/service/dist/routes/business-information-notice.js +6 -2
  137. package/node_modules/@noodle-borg/service/dist/routes/business-information-pages.js +1 -1
  138. package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +1 -1
  139. package/node_modules/@noodle-borg/service/dist/routes/business-information-record-create.js +7 -2
  140. package/node_modules/@noodle-borg/service/dist/routes/business-information-record-reads.js +2 -2
  141. package/node_modules/@noodle-borg/service/dist/routes/business-information-records.js +332 -0
  142. package/node_modules/@noodle-borg/service/dist/routes/business-information-settings.js +6 -3
  143. package/node_modules/@noodle-borg/service/dist/routes/business-information-staff.js +9 -5
  144. package/node_modules/@noodle-borg/service/dist/routes/business-information.js +12 -356
  145. package/node_modules/@noodle-borg/service/dist/routes/business-native-lifecycle.js +46 -0
  146. package/node_modules/@noodle-borg/service/dist/routes/business-workspaces.js +14 -1
  147. package/node_modules/@noodle-borg/service/dist/service.js +1 -0
  148. package/node_modules/@noodle-borg/service/dist/web-capabilities.js +3 -1
  149. package/node_modules/@noodle-borg/service/package.json +2 -1
  150. package/node_modules/@noodle-borg/wire-contracts/dist/application-draft-validation.d.ts +59 -0
  151. package/node_modules/@noodle-borg/wire-contracts/dist/application-draft-validation.js +38 -0
  152. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +144 -50
  153. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +44 -4
  154. package/node_modules/@noodle-borg/wire-contracts/dist/business-workspaces.d.ts +70 -0
  155. package/node_modules/@noodle-borg/wire-contracts/dist/business-workspaces.js +31 -1
  156. package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +2 -0
  157. package/node_modules/@noodle-borg/wire-contracts/dist/index.js +2 -0
  158. package/node_modules/@noodle-borg/wire-contracts/dist/native-record-lifecycle.d.ts +81 -0
  159. package/node_modules/@noodle-borg/wire-contracts/dist/native-record-lifecycle.js +39 -0
  160. package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.d.ts +26 -0
  161. package/node_modules/@noodle-borg/wire-contracts/dist/whatsapp.js +24 -1
  162. package/package.json +2 -2
@@ -64,7 +64,8 @@
64
64
  */
65
65
  /** `0.21.0`: protected tools may opt into public descriptor discovery without execution permission. */
66
66
  /** `0.22.0`: governed public-page extraction declarations and ordinary generated tools. */
67
- export declare const ARTIFACT_SCHEMA_VERSION = "0.22.0";
67
+ /** `0.23.0`: bounded `collect` interaction metadata keyed by opener tool (ADR 0240); never MCP-visible. */
68
+ export declare const ARTIFACT_SCHEMA_VERSION = "0.23.0";
68
69
  /** mimeType for an MCP Apps UI resource (SEP-1865). Widgets are served under this profile. */
69
70
  export declare const MCP_APP_MIME_TYPE = "text/html;profile=mcp-app";
70
71
  //# sourceMappingURL=version.d.ts.map
@@ -64,7 +64,8 @@
64
64
  */
65
65
  /** `0.21.0`: protected tools may opt into public descriptor discovery without execution permission. */
66
66
  /** `0.22.0`: governed public-page extraction declarations and ordinary generated tools. */
67
- export const ARTIFACT_SCHEMA_VERSION = '0.22.0';
67
+ /** `0.23.0`: bounded `collect` interaction metadata keyed by opener tool (ADR 0240); never MCP-visible. */
68
+ export const ARTIFACT_SCHEMA_VERSION = '0.23.0';
68
69
  /** mimeType for an MCP Apps UI resource (SEP-1865). Widgets are served under this profile. */
69
70
  export const MCP_APP_MIME_TYPE = 'text/html;profile=mcp-app';
70
71
  //# sourceMappingURL=version.js.map
@@ -15,6 +15,7 @@ import { parseAmbientContext } from './context-compile.js';
15
15
  import { findExternalRef, parseFulfilment } from './fulfilment-structural.js';
16
16
  import { compileManagedCollections } from './managed-collections.js';
17
17
  import { cspOriginFaults } from './manifest/csp-origins.js';
18
+ import { compileToolInteractions } from './manifest/interaction-validation.js';
18
19
  import { parseManifestDocument } from './manifest/parse-document.js';
19
20
  import { manifestSchema } from './manifest/schema.js';
20
21
  import { resolveSchemaUses } from './manifest/schema-refs.js';
@@ -416,11 +417,14 @@ export function compileManifest(raw, options = {}) {
416
417
  toolUiMetaByName,
417
418
  errors,
418
419
  });
420
+ const toolInteractions = compileToolInteractions(manifest.tools, artifactTools, errors);
419
421
  errors.push(...validateWebsiteProjection(manifest.server.assistant, {
420
422
  tools: artifactTools,
421
423
  resources: artifactResources,
422
424
  prompts: artifactPrompts,
423
425
  knowledge,
426
+ interactions: toolInteractions,
427
+ connectors: declared,
424
428
  }));
425
429
  if (errors.length > 0) {
426
430
  return { ok: false, errors };
@@ -445,6 +449,7 @@ export function compileManifest(raw, options = {}) {
445
449
  ...(knowledge.length > 0 ? { knowledge } : {}),
446
450
  ...(managedCollections.length > 0 ? { managedCollections } : {}),
447
451
  ...(variables.length > 0 ? { variables } : {}),
452
+ ...(toolInteractions === undefined ? {} : { toolInteractions }),
448
453
  });
449
454
  const warnings = [
450
455
  ...brandingWarnings(manifest.server.branding),
@@ -1,7 +1,7 @@
1
1
  import type { AppPackageArtifactV1 } from '@noodle-borg/app-package';
2
2
  import type { RuntimeArtifact } from './artifact/types.js';
3
3
  import type { PackagedAsset } from './assets.js';
4
- export type CompileErrorCode = 'invalid_context_provider' | 'yaml_parse_error' | 'invalid_shape' | 'invalid_name' | 'duplicate_name' | 'reserved_name' | 'unsupported_manifest_version' | 'reserved_for_future_version' | 'invalid_operation_ref' | 'external_ref' | 'invalid_schema_ref' | 'unknown_schema_ref' | 'schema_ref_conflict' | 'invalid_expression' | 'expr_unknown_root' | 'expr_root_unavailable' | 'expr_operator_not_allowed' | 'expr_if_not_boolean' | 'unknown_step_ref' | 'forward_step_ref' | 'self_step_ref' | 'duplicate_step_id' | 'invalid_fulfilment' | 'invalid_elicitation_schema' | 'invalid_elicitation_flow' | 'invalid_confirmation_flow' | 'arg_type_mismatch' | 'ambient_context_action' | 'duplicate_resource' | 'duplicate_prompt' | 'duplicate_resource_uri' | 'unsupported_uri_template' | 'duplicate_widget' | 'unknown_widget_tool' | 'unknown_widget_action_tool' | 'duplicate_widget_tool' | 'invalid_widget_binding' | 'invalid_widget_state_handle' | 'widget_html_too_large' | 'widget_html_total_too_large' | 'invalid_asset' | 'invalid_capability_requirement' | 'state_secret_field' | 'invalid_knowledge' | 'knowledge_unhashed' | 'invalid_managed_collection' | 'invalid_variable_declaration' | 'invalid_managed_collection_source' | 'unknown_connector_alias' | 'connector_not_in_catalog' | 'unknown_operation' | 'connector_binding_required' | 'ambiguous_nested_connector_binding' | 'invalid_connector_call_graph' | 'unsupported_credential_profile' | 'credential_scope_mismatch' | 'credential_audience_mismatch' | 'customer_endpoint_auth_required' | 'customer_endpoint_mapping_required' | 'customer_endpoint_unknown_mapping' | 'customer_endpoint_bridge_unsupported' | 'assistant_messaging_unsupported' | 'assistant_capability_unknown' | 'assistant_public_user_reference' | 'assistant_public_effect_unconfirmed' | 'customer_endpoint_action_unsupported' | 'customer_endpoint_surface_unsupported' | 'customer_endpoint_credential_source_unsupported' | 'customer_endpoint_policy_conflict' | 'customer_endpoint_routing_inconsistent' | 'unused_connector_alias' | 'arg_mismatch' | 'agent_guide_invalid' | 'agent_guide_duplicate_workflow' | 'agent_guide_duplicate_example' | 'agent_guide_example_workflow_missing' | 'agent_guide_capability_missing' | 'agent_guide_capability_kind' | 'app_package_sensitive_content';
4
+ export type CompileErrorCode = 'invalid_context_provider' | 'yaml_parse_error' | 'invalid_shape' | 'invalid_name' | 'duplicate_name' | 'reserved_name' | 'unsupported_manifest_version' | 'reserved_for_future_version' | 'invalid_operation_ref' | 'external_ref' | 'invalid_schema_ref' | 'unknown_schema_ref' | 'schema_ref_conflict' | 'invalid_expression' | 'expr_unknown_root' | 'expr_root_unavailable' | 'expr_operator_not_allowed' | 'expr_if_not_boolean' | 'unknown_step_ref' | 'forward_step_ref' | 'self_step_ref' | 'duplicate_step_id' | 'invalid_fulfilment' | 'invalid_elicitation_schema' | 'invalid_elicitation_flow' | 'invalid_confirmation_flow' | 'arg_type_mismatch' | 'ambient_context_action' | 'duplicate_resource' | 'duplicate_prompt' | 'duplicate_resource_uri' | 'unsupported_uri_template' | 'duplicate_widget' | 'unknown_widget_tool' | 'unknown_widget_action_tool' | 'duplicate_widget_tool' | 'invalid_widget_binding' | 'invalid_widget_state_handle' | 'widget_html_too_large' | 'widget_html_total_too_large' | 'invalid_asset' | 'invalid_capability_requirement' | 'state_secret_field' | 'invalid_knowledge' | 'knowledge_unhashed' | 'invalid_managed_collection' | 'invalid_variable_declaration' | 'invalid_managed_collection_source' | 'unknown_connector_alias' | 'connector_not_in_catalog' | 'unknown_operation' | 'connector_binding_required' | 'ambiguous_nested_connector_binding' | 'invalid_connector_call_graph' | 'unsupported_credential_profile' | 'credential_scope_mismatch' | 'credential_audience_mismatch' | 'customer_endpoint_auth_required' | 'customer_endpoint_mapping_required' | 'customer_endpoint_unknown_mapping' | 'customer_endpoint_bridge_unsupported' | 'assistant_messaging_unsupported' | 'assistant_capability_unknown' | 'assistant_public_user_reference' | 'assistant_public_effect_unconfirmed' | 'interaction_action_invalid' | 'interaction_field_unknown' | 'interaction_field_control_mismatch' | 'interaction_field_missing' | 'interaction_initial_value_unknown' | 'interaction_consent_invalid' | 'interaction_expiry_invalid' | 'channel_dependency_missing' | 'channel_requirement_unsupported' | 'customer_endpoint_action_unsupported' | 'customer_endpoint_surface_unsupported' | 'customer_endpoint_credential_source_unsupported' | 'customer_endpoint_policy_conflict' | 'customer_endpoint_routing_inconsistent' | 'unused_connector_alias' | 'arg_mismatch' | 'agent_guide_invalid' | 'agent_guide_duplicate_workflow' | 'agent_guide_duplicate_example' | 'agent_guide_example_workflow_missing' | 'agent_guide_capability_missing' | 'agent_guide_capability_kind' | 'app_package_sensitive_content';
5
5
  export interface CompileError {
6
6
  readonly code: CompileErrorCode;
7
7
  /** Dotted path to the offending location (e.g. `tools.1.name`); empty string for the document root. */
@@ -3,7 +3,7 @@ export { APP_PACKAGE_V1_VALIDATION_LIMITS, appPackageArtifactV1Schema, canonical
3
3
  export { type ParsedUri, type ParseUriResult, parseUriTemplate, type TemplateUri, } from '@noodle-borg/uri-template';
4
4
  export { compileAppPackage } from './app-package/compile.js';
5
5
  export { isSafeReadTool, requiresToolConfirmation } from './artifact/consent.js';
6
- export { ARTIFACT_SCHEMA_VERSION, type ArtifactConnectionSource, type ArtifactConnectorBinding, type ArtifactCustomerAuthRouting, type ArtifactFulfilment, type ArtifactManagedCollection, type ArtifactMeta, type ArtifactPackagedAsset, type ArtifactPrompt, type ArtifactPromptArgument, type ArtifactResource, type ArtifactServer, type ArtifactServerContext, type ArtifactState, type ArtifactStateHandle, type ArtifactStateHandleKind, type ArtifactStateHandleScope, type ArtifactStep, type ArtifactTool, type ArtifactToolAuthorization, type ExprMap, type JsonSchema, MCP_APP_MIME_TYPE, type OperationRef, type ResolvedCredentialBinding, type ResolvedOperationRef, type RuntimeArtifact, type UnresolvedOperationRef, type WidgetUiMeta, } from './artifact/types.js';
6
+ export { ARTIFACT_SCHEMA_VERSION, type ArtifactCollectField, type ArtifactCollectInteraction, type ArtifactConnectionSource, type ArtifactConnectorBinding, type ArtifactCustomerAuthRouting, type ArtifactFulfilment, type ArtifactManagedCollection, type ArtifactMeta, type ArtifactPackagedAsset, type ArtifactPrompt, type ArtifactPromptArgument, type ArtifactResource, type ArtifactServer, type ArtifactServerContext, type ArtifactState, type ArtifactStateHandle, type ArtifactStateHandleKind, type ArtifactStateHandleScope, type ArtifactStep, type ArtifactTool, type ArtifactToolAuthorization, type ExprMap, type JsonSchema, MCP_APP_MIME_TYPE, type OperationRef, type ResolvedCredentialBinding, type ResolvedOperationRef, type RuntimeArtifact, type UnresolvedOperationRef, type WidgetUiMeta, } from './artifact/types.js';
7
7
  export { assetReference, type HostedAssetOptions, type HostedPackagedAsset, isPackagedAssetReference, type LocalAssetOptions, localAssetRoutePrefix, type PackagedAsset, type PackagedAssetReference, type PreparedPackagedAsset, prepareLocalAssets, } from './assets.js';
8
8
  export { type ArtifactVariableDeclaration, compileVariableDeclarations, MAX_VARIABLE_DECLARATIONS, MAX_VARIABLE_SCHEMA_BYTES, MAX_VARIABLE_SCHEMA_DEPTH, MAX_VARIABLE_VALUE_BYTES, type VariableDeclarationManifest, validateVariableDeclaration, variableDeclarationManifestSchema, } from './business-variables.js';
9
9
  export { InMemoryCatalog } from './catalog/in-memory.js';
@@ -21,7 +21,7 @@ export { type ArrayNode, type CoalesceNode, type CondNode, type ExprNode, type O
21
21
  export { isValidName, parseOperationRef } from './manifest/naming.js';
22
22
  export { type Manifest, manifestSchema } from './manifest/schema.js';
23
23
  export { type ResolveSchemaResult, resolveSchemaUses, type SchemasMap, } from './manifest/schema-refs.js';
24
- export { anonymousBehavior } from './manifest/website-projection.js';
24
+ export { anonymousBehavior, isNativeRecordsOperation } from './manifest/website-projection.js';
25
25
  export { type SniffedImage, sniffImageBytes } from './mime-sniffing.js';
26
26
  export { BUILTIN_RECORD_CATALOG_CONNECTOR, RECORD_CONNECTOR_ID, RECORD_CONNECTOR_VERSION, RECORD_OPERATION_SIGNATURES, } from './native-record-operations.js';
27
27
  export { manifestJsonSchema } from './schema-export.js';
@@ -18,7 +18,7 @@ export { parseCondition, parseValue, } from './manifest/expression.js';
18
18
  export { isValidName, parseOperationRef } from './manifest/naming.js';
19
19
  export { manifestSchema } from './manifest/schema.js';
20
20
  export { resolveSchemaUses, } from './manifest/schema-refs.js';
21
- export { anonymousBehavior } from './manifest/website-projection.js';
21
+ export { anonymousBehavior, isNativeRecordsOperation } from './manifest/website-projection.js';
22
22
  export { sniffImageBytes } from './mime-sniffing.js';
23
23
  export { BUILTIN_RECORD_CATALOG_CONNECTOR, RECORD_CONNECTOR_ID, RECORD_CONNECTOR_VERSION, RECORD_OPERATION_SIGNATURES, } from './native-record-operations.js';
24
24
  export { manifestJsonSchema } from './schema-export.js';
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The `collect` interaction block (ADR 0240): bounded metadata on an opener tool describing which
4
+ * fields a platform renderer collects for one confirmed action, which are private, what is reviewed,
5
+ * and what to say on success. It carries meaning only: no layout, ordering script or screen language.
6
+ * Field, action and output references are checked against the declared tools by the compile pass
7
+ * (`interaction-validation.ts`), which also bounds `confirmationExpiry` so a bad value reports its own
8
+ * code instead of a shape error.
9
+ */
10
+ export declare const COLLECT_CONTROLS: readonly ["text", "textarea", "email", "phone", "url", "select", "consent"];
11
+ export type CollectControl = (typeof COLLECT_CONTROLS)[number];
12
+ export declare const toolInteractionSchema: z.ZodObject<{
13
+ kind: z.ZodLiteral<"collect">;
14
+ action: z.ZodString;
15
+ initialValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
16
+ fromOutput: z.ZodString;
17
+ }, z.core.$strict>>>;
18
+ fields: z.ZodArray<z.ZodObject<{
19
+ key: z.ZodString;
20
+ control: z.ZodEnum<{
21
+ email: "email";
22
+ text: "text";
23
+ textarea: "textarea";
24
+ phone: "phone";
25
+ url: "url";
26
+ select: "select";
27
+ consent: "consent";
28
+ }>;
29
+ private: z.ZodOptional<z.ZodLiteral<true>>;
30
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
31
+ }, z.core.$strict>>;
32
+ review: z.ZodLiteral<"all">;
33
+ outcome: z.ZodObject<{
34
+ success: z.ZodString;
35
+ }, z.core.$strict>;
36
+ confirmationExpiry: z.ZodOptional<z.ZodObject<{
37
+ seconds: z.ZodNumber;
38
+ }, z.core.$strict>>;
39
+ }, z.core.$strict>;
40
+ export type ToolInteractionManifest = z.infer<typeof toolInteractionSchema>;
41
+ //# sourceMappingURL=interaction-schema.d.ts.map
@@ -0,0 +1,62 @@
1
+ import { z } from 'zod';
2
+ import { NAME_PATTERN } from './naming.js';
3
+ /**
4
+ * The `collect` interaction block (ADR 0240): bounded metadata on an opener tool describing which
5
+ * fields a platform renderer collects for one confirmed action, which are private, what is reviewed,
6
+ * and what to say on success. It carries meaning only: no layout, ordering script or screen language.
7
+ * Field, action and output references are checked against the declared tools by the compile pass
8
+ * (`interaction-validation.ts`), which also bounds `confirmationExpiry` so a bad value reports its own
9
+ * code instead of a shape error.
10
+ */
11
+ export const COLLECT_CONTROLS = [
12
+ 'text',
13
+ 'textarea',
14
+ 'email',
15
+ 'phone',
16
+ 'url',
17
+ 'select',
18
+ 'consent',
19
+ ];
20
+ const MAX_COLLECT_FIELDS = 32;
21
+ const MAX_PROPERTY_KEY_CHARS = 128;
22
+ const MAX_OUTCOME_CHARS = 280;
23
+ const propertyKeySchema = z.string().min(1).max(MAX_PROPERTY_KEY_CHARS);
24
+ const collectFieldSchema = z
25
+ .object({
26
+ key: propertyKeySchema,
27
+ control: z.enum(COLLECT_CONTROLS),
28
+ /** Never enters the conversation model, transcript, logs or diagnostics. Opt-in per field. */
29
+ private: z.literal(true).optional(),
30
+ /** The person may leave it blank; the renderer submits the schema's empty value. */
31
+ optional: z.literal(true).optional(),
32
+ })
33
+ .strict();
34
+ export const toolInteractionSchema = z
35
+ .object({
36
+ kind: z.literal('collect'),
37
+ /** The confirmed action tool this collection prepares, by name. */
38
+ action: z.string().regex(NAME_PATTERN),
39
+ /** Action input property -> the opener output property that seeds it. */
40
+ initialValues: z
41
+ .record(propertyKeySchema, z.object({ fromOutput: propertyKeySchema }).strict())
42
+ .optional(),
43
+ fields: z
44
+ .array(collectFieldSchema)
45
+ .min(1)
46
+ .max(MAX_COLLECT_FIELDS)
47
+ .superRefine((fields, ctx) => {
48
+ const seen = new Set();
49
+ for (const field of fields) {
50
+ if (seen.has(field.key)) {
51
+ ctx.addIssue({ code: 'custom', message: `duplicate field key "${field.key}"` });
52
+ }
53
+ seen.add(field.key);
54
+ }
55
+ }),
56
+ review: z.literal('all'),
57
+ outcome: z.object({ success: z.string().trim().min(1).max(MAX_OUTCOME_CHARS) }).strict(),
58
+ /** A developer may only shorten the profile default; the compile pass checks the bound. */
59
+ confirmationExpiry: z.object({ seconds: z.number() }).strict().optional(),
60
+ })
61
+ .strict();
62
+ //# sourceMappingURL=interaction-schema.js.map
@@ -0,0 +1,220 @@
1
+ /**
2
+ * Compile-time checks for the `collect` interaction block (ADR 0240). Every field must be an input of
3
+ * the action it prepares with a control its schema can honor; every required action input must be
4
+ * collected or seeded from the opener's output; consent is a single fixed-true boolean; and the
5
+ * developer may only shorten the confirmation expiry within the platform ceiling. Valid blocks are
6
+ * emitted keyed by opener tool as system-owned artifact data, never onto the MCP-visible descriptor.
7
+ */
8
+ /** The 24-hour platform ceiling (email profile default); every profile default sits below it. */
9
+ const MAX_CONFIRMATION_EXPIRY_SECONDS = 86_400;
10
+ export function compileToolInteractions(tools, artifactTools, errors) {
11
+ const byName = new Map(artifactTools.map((tool) => [tool.name, tool]));
12
+ const emitted = {};
13
+ tools.forEach((tool, index) => {
14
+ if (tool.interaction === undefined)
15
+ return;
16
+ const opener = byName.get(tool.name);
17
+ if (opener === undefined)
18
+ return; // a structural error on this tool was already recorded
19
+ const before = errors.length;
20
+ validateCollect(tool.interaction, opener, byName, `tools.${index}.interaction`, errors);
21
+ if (errors.length === before)
22
+ emitted[tool.name] = toArtifact(tool.interaction);
23
+ });
24
+ return Object.keys(emitted).length > 0 ? emitted : undefined;
25
+ }
26
+ function validateCollect(interaction, opener, byName, path, errors) {
27
+ const action = byName.get(interaction.action);
28
+ if (action === undefined) {
29
+ errors.push({
30
+ code: 'interaction_action_invalid',
31
+ path: `${path}.action`,
32
+ message: `interaction action "${interaction.action}" is not a declared tool`,
33
+ });
34
+ return;
35
+ }
36
+ if (action.annotations?.confirm !== true || action.annotations?.readOnlyHint === true) {
37
+ errors.push({
38
+ code: 'interaction_action_invalid',
39
+ path: `${path}.action`,
40
+ message: `interaction action "${action.name}" must set { confirm: true } and must not be read-only`,
41
+ });
42
+ return;
43
+ }
44
+ const inputs = objectProperties(action.inputSchema);
45
+ const required = new Set(stringList(action.inputSchema.required));
46
+ const outputs = objectProperties(opener.outputSchema);
47
+ const covered = new Set();
48
+ let consents = 0;
49
+ interaction.fields.forEach((field, index) => {
50
+ const fieldPath = `${path}.fields.${index}`;
51
+ const property = inputs[field.key];
52
+ if (property === undefined) {
53
+ errors.push({
54
+ code: 'interaction_field_unknown',
55
+ path: fieldPath,
56
+ message: `field "${field.key}" is not an input of action "${action.name}"`,
57
+ });
58
+ return;
59
+ }
60
+ covered.add(field.key);
61
+ if (field.control === 'consent')
62
+ consents += 1;
63
+ const mismatch = controlMismatch(field.control, property);
64
+ if (mismatch !== undefined) {
65
+ errors.push({
66
+ code: 'interaction_field_control_mismatch',
67
+ path: fieldPath,
68
+ message: `field "${field.key}" uses control "${field.control}" but its input schema ${mismatch}`,
69
+ });
70
+ }
71
+ if (field.optional === true) {
72
+ if (required.has(field.key) && !acceptsEmptyString(property)) {
73
+ errors.push({
74
+ code: 'interaction_field_missing',
75
+ path: fieldPath,
76
+ message: `optional field "${field.key}" is required by action "${action.name}" and rejects the empty value; make the property optional or let it accept ""`,
77
+ });
78
+ }
79
+ }
80
+ else if (!required.has(field.key)) {
81
+ errors.push({
82
+ code: 'interaction_field_missing',
83
+ path: fieldPath,
84
+ message: `field "${field.key}" is not required by action "${action.name}"; mark it optional: true or require it`,
85
+ });
86
+ }
87
+ });
88
+ if (consents > 1) {
89
+ errors.push({
90
+ code: 'interaction_consent_invalid',
91
+ path: `${path}.fields`,
92
+ message: 'a collect interaction poses at most one consent question',
93
+ });
94
+ }
95
+ for (const [target, source] of Object.entries(interaction.initialValues ?? {})) {
96
+ const valuePath = `${path}.initialValues.${target}`;
97
+ if (inputs[target] === undefined) {
98
+ errors.push({
99
+ code: 'interaction_initial_value_unknown',
100
+ path: valuePath,
101
+ message: `initial value "${target}" is not an input of action "${action.name}"`,
102
+ });
103
+ }
104
+ else {
105
+ covered.add(target);
106
+ }
107
+ if (outputs[source.fromOutput] === undefined) {
108
+ errors.push({
109
+ code: 'interaction_initial_value_unknown',
110
+ path: `${valuePath}.fromOutput`,
111
+ message: `initial value "${target}" reads "${source.fromOutput}", which "${opener.name}" does not output`,
112
+ });
113
+ }
114
+ }
115
+ for (const key of required) {
116
+ if (covered.has(key))
117
+ continue;
118
+ errors.push({
119
+ code: 'interaction_field_missing',
120
+ path: `${path}.fields`,
121
+ message: `required input "${key}" of action "${action.name}" is neither a field nor an initial value`,
122
+ });
123
+ }
124
+ const seconds = interaction.confirmationExpiry?.seconds;
125
+ if (seconds !== undefined &&
126
+ !(Number.isInteger(seconds) && seconds >= 1 && seconds <= MAX_CONFIRMATION_EXPIRY_SECONDS)) {
127
+ errors.push({
128
+ code: 'interaction_expiry_invalid',
129
+ path: `${path}.confirmationExpiry.seconds`,
130
+ message: `confirmationExpiry.seconds must be a whole number from 1 to ${MAX_CONFIRMATION_EXPIRY_SECONDS}`,
131
+ });
132
+ }
133
+ }
134
+ /** Why `control` cannot render `property`, or undefined when the schema supports it. */
135
+ function controlMismatch(control, property) {
136
+ switch (control) {
137
+ case 'consent':
138
+ return property.type === 'boolean' && isFixedTrue(property)
139
+ ? undefined
140
+ : 'is not a boolean fixed to true';
141
+ case 'select':
142
+ return property.type === 'string' && isStringEnum(property.enum)
143
+ ? undefined
144
+ : 'is not an enum of strings';
145
+ case 'email':
146
+ if (property.type !== 'string')
147
+ return 'is not a string';
148
+ return property.format === undefined || property.format === 'email'
149
+ ? undefined
150
+ : `declares format "${String(property.format)}"`;
151
+ default:
152
+ return property.type === 'string' ? undefined : 'is not a string';
153
+ }
154
+ }
155
+ function isFixedTrue(property) {
156
+ if (property.const === true)
157
+ return true;
158
+ return Array.isArray(property.enum) && property.enum.length === 1 && property.enum[0] === true;
159
+ }
160
+ function isStringEnum(value) {
161
+ return Array.isArray(value) && value.length > 0 && value.every((v) => typeof v === 'string');
162
+ }
163
+ /**
164
+ * Whether `""` satisfies a string property, so an optional field the action still requires can be
165
+ * submitted blank. Any format, a positive minLength, or a pattern/enum/const rejecting `""` means no.
166
+ */
167
+ function acceptsEmptyString(property) {
168
+ if (property.type !== 'string' || property.format !== undefined)
169
+ return false;
170
+ if (typeof property.minLength === 'number' && property.minLength > 0)
171
+ return false;
172
+ if (property.const !== undefined && property.const !== '')
173
+ return false;
174
+ if (Array.isArray(property.enum) && !property.enum.includes(''))
175
+ return false;
176
+ return typeof property.pattern === 'string' ? patternMatchesEmpty(property.pattern) : true;
177
+ }
178
+ function patternMatchesEmpty(pattern) {
179
+ for (const flags of ['u', '']) {
180
+ try {
181
+ return new RegExp(pattern, flags).test('');
182
+ }
183
+ catch {
184
+ // An invalid pattern under this flag set; try the next, then fail closed.
185
+ }
186
+ }
187
+ return false;
188
+ }
189
+ function objectProperties(schema) {
190
+ const properties = schema?.properties;
191
+ if (typeof properties !== 'object' || properties === null || Array.isArray(properties))
192
+ return {};
193
+ return Object.fromEntries(Object.entries(properties).flatMap(([key, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)
194
+ ? [[key, value]]
195
+ : []));
196
+ }
197
+ function stringList(value) {
198
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
199
+ }
200
+ function toArtifact(interaction) {
201
+ return {
202
+ kind: 'collect',
203
+ action: interaction.action,
204
+ fields: interaction.fields.map((field) => ({
205
+ key: field.key,
206
+ control: field.control,
207
+ ...(field.private === true ? { private: true } : {}),
208
+ ...(field.optional === true ? { optional: true } : {}),
209
+ })),
210
+ ...(interaction.initialValues === undefined
211
+ ? {}
212
+ : { initialValues: interaction.initialValues }),
213
+ review: 'all',
214
+ outcome: { success: interaction.outcome.success },
215
+ ...(interaction.confirmationExpiry === undefined
216
+ ? {}
217
+ : { confirmationExpirySeconds: interaction.confirmationExpiry.seconds }),
218
+ };
219
+ }
220
+ //# sourceMappingURL=interaction-validation.js.map
@@ -11,10 +11,10 @@ export declare const manifestV1Schema: z.ZodObject<{
11
11
  state: z.ZodOptional<z.ZodObject<{
12
12
  handles: z.ZodRecord<z.ZodString, z.ZodObject<{
13
13
  kind: z.ZodEnum<{
14
+ search: "search";
14
15
  session: "session";
15
16
  draft: "draft";
16
17
  selection: "selection";
17
- search: "search";
18
18
  cart: "cart";
19
19
  workflow: "workflow";
20
20
  }>;
@@ -557,10 +557,10 @@ export declare const manifestV2Schema: z.ZodObject<{
557
557
  state: z.ZodOptional<z.ZodObject<{
558
558
  handles: z.ZodRecord<z.ZodString, z.ZodObject<{
559
559
  kind: z.ZodEnum<{
560
+ search: "search";
560
561
  session: "session";
561
562
  draft: "draft";
562
563
  selection: "selection";
563
- search: "search";
564
564
  cart: "cart";
565
565
  workflow: "workflow";
566
566
  }>;
@@ -1238,6 +1238,34 @@ export declare const manifestV2Schema: z.ZodObject<{
1238
1238
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1239
1239
  }, z.core.$strip>;
1240
1240
  contextProvider: z.ZodOptional<z.ZodLiteral<true>>;
1241
+ interaction: z.ZodOptional<z.ZodObject<{
1242
+ kind: z.ZodLiteral<"collect">;
1243
+ action: z.ZodString;
1244
+ initialValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1245
+ fromOutput: z.ZodString;
1246
+ }, z.core.$strict>>>;
1247
+ fields: z.ZodArray<z.ZodObject<{
1248
+ key: z.ZodString;
1249
+ control: z.ZodEnum<{
1250
+ email: "email";
1251
+ text: "text";
1252
+ textarea: "textarea";
1253
+ phone: "phone";
1254
+ url: "url";
1255
+ select: "select";
1256
+ consent: "consent";
1257
+ }>;
1258
+ private: z.ZodOptional<z.ZodLiteral<true>>;
1259
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
1260
+ }, z.core.$strict>>;
1261
+ review: z.ZodLiteral<"all">;
1262
+ outcome: z.ZodObject<{
1263
+ success: z.ZodString;
1264
+ }, z.core.$strict>;
1265
+ confirmationExpiry: z.ZodOptional<z.ZodObject<{
1266
+ seconds: z.ZodNumber;
1267
+ }, z.core.$strict>>;
1268
+ }, z.core.$strict>>;
1241
1269
  }, z.core.$strip>>;
1242
1270
  connectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1243
1271
  id: z.ZodString;
@@ -1285,10 +1313,10 @@ export declare const manifestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1285
1313
  state: z.ZodOptional<z.ZodObject<{
1286
1314
  handles: z.ZodRecord<z.ZodString, z.ZodObject<{
1287
1315
  kind: z.ZodEnum<{
1316
+ search: "search";
1288
1317
  session: "session";
1289
1318
  draft: "draft";
1290
1319
  selection: "selection";
1291
- search: "search";
1292
1320
  cart: "cart";
1293
1321
  workflow: "workflow";
1294
1322
  }>;
@@ -1830,10 +1858,10 @@ export declare const manifestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1830
1858
  state: z.ZodOptional<z.ZodObject<{
1831
1859
  handles: z.ZodRecord<z.ZodString, z.ZodObject<{
1832
1860
  kind: z.ZodEnum<{
1861
+ search: "search";
1833
1862
  session: "session";
1834
1863
  draft: "draft";
1835
1864
  selection: "selection";
1836
- search: "search";
1837
1865
  cart: "cart";
1838
1866
  workflow: "workflow";
1839
1867
  }>;
@@ -2511,6 +2539,34 @@ export declare const manifestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2511
2539
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2512
2540
  }, z.core.$strip>;
2513
2541
  contextProvider: z.ZodOptional<z.ZodLiteral<true>>;
2542
+ interaction: z.ZodOptional<z.ZodObject<{
2543
+ kind: z.ZodLiteral<"collect">;
2544
+ action: z.ZodString;
2545
+ initialValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2546
+ fromOutput: z.ZodString;
2547
+ }, z.core.$strict>>>;
2548
+ fields: z.ZodArray<z.ZodObject<{
2549
+ key: z.ZodString;
2550
+ control: z.ZodEnum<{
2551
+ email: "email";
2552
+ text: "text";
2553
+ textarea: "textarea";
2554
+ phone: "phone";
2555
+ url: "url";
2556
+ select: "select";
2557
+ consent: "consent";
2558
+ }>;
2559
+ private: z.ZodOptional<z.ZodLiteral<true>>;
2560
+ optional: z.ZodOptional<z.ZodLiteral<true>>;
2561
+ }, z.core.$strict>>;
2562
+ review: z.ZodLiteral<"all">;
2563
+ outcome: z.ZodObject<{
2564
+ success: z.ZodString;
2565
+ }, z.core.$strict>;
2566
+ confirmationExpiry: z.ZodOptional<z.ZodObject<{
2567
+ seconds: z.ZodNumber;
2568
+ }, z.core.$strict>>;
2569
+ }, z.core.$strict>>;
2514
2570
  }, z.core.$strip>>;
2515
2571
  connectors: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2516
2572
  id: z.ZodString;
@@ -7,6 +7,7 @@ import { MAX_COMPILED_WIDGET_HTML_BYTES, MAX_RAW_WIDGET_HTML_BYTES } from '../wi
7
7
  import { agentGuideSchema } from './agent-guide-schema.js';
8
8
  import { serverAuthSchema, serverAuthV2Schema } from './auth-schema.js';
9
9
  import { assistantOriginOrVariableSchema, httpsUrlSchema, managedVariableExpressionSchema, serverBrandingSchema, } from './branding-schema.js';
10
+ import { toolInteractionSchema } from './interaction-schema.js';
10
11
  import { NAME_PATTERN } from './naming.js';
11
12
  /**
12
13
  * Zod schema for Core v1 and v2 manifests (ADRs 0150 and 0157). V1 remains accepted unchanged;
@@ -115,7 +116,12 @@ const toolSchema = z.object({
115
116
  .optional(),
116
117
  fulfilment: fulfilmentSchema,
117
118
  });
118
- const toolV2Schema = toolSchema.extend({ contextProvider: z.literal(true).optional() });
119
+ const toolV2Schema = toolSchema.extend({
120
+ contextProvider: z.literal(true).optional(),
121
+ // Additive optional field: a v1.x minor under ADR 0150. Bounded `collect` interaction metadata
122
+ // (ADR 0240) an opener tool declares for one confirmed action; references are checked in compile().
123
+ interaction: toolInteractionSchema.optional(),
124
+ });
119
125
  /**
120
126
  * An MCP resource. Like a tool, it carries a `fulfilment` (it can return a constant or call connectors);
121
127
  * its `uri` is a fixed URI or a simple `{var}` URI template (validated in compile()). The compile pass
@@ -1,4 +1,4 @@
1
- import type { ArtifactPrompt, ArtifactResource, ArtifactTool } from '../artifact/types.js';
1
+ import type { ArtifactCollectInteraction, ArtifactPrompt, ArtifactResource, ArtifactTool, OperationRef } from '../artifact/types.js';
2
2
  import type { CompileError } from '../errors.js';
3
3
  /**
4
4
  * Compile-time enforcement of website assistant surfaces (ADR 0201, amended 2026-08-12). These are
@@ -36,9 +36,17 @@ export interface WebsiteProjectionSurfaces {
36
36
  readonly knowledge?: readonly {
37
37
  readonly name: string;
38
38
  }[] | undefined;
39
+ /** `collect` interactions keyed by opener (ADR 0240); a messaging surface presents them natively. */
40
+ readonly interactions?: Readonly<Record<string, ArtifactCollectInteraction>> | undefined;
41
+ /** Declared connector aliases, so a shape-only operation ref still names its connector id. */
42
+ readonly connectors?: Readonly<Record<string, {
43
+ readonly id: string;
44
+ }>> | undefined;
39
45
  }
40
46
  /** A tool touches identity when it reads `${user}` or requires verified claims (ADR 0185). */
41
47
  export declare function anonymousBehavior(tool: ArtifactTool): 'public-safe' | 'requires-identity';
42
48
  export declare function validateWebsiteProjection(assistant: AssistantProjectionInput | undefined, surfaces: WebsiteProjectionSurfaces): readonly CompileError[];
49
+ /** Resolved refs carry the connector id; a shape-only ref is looked up through its declared alias. */
50
+ export declare function isNativeRecordsOperation(operation: OperationRef, connectors: WebsiteProjectionSurfaces['connectors']): boolean;
43
51
  export {};
44
52
  //# sourceMappingURL=website-projection.d.ts.map