@simple-ai-lab/sdk 0.11.0 → 0.14.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 (42) hide show
  1. package/README.md +1 -0
  2. package/dist/actions.cjs +29 -0
  3. package/dist/actions.d.cts +35 -1
  4. package/dist/actions.d.ts +35 -1
  5. package/dist/actions.js +30 -1
  6. package/dist/agents.cjs +187 -15
  7. package/dist/agents.d.cts +231 -9
  8. package/dist/agents.d.ts +231 -9
  9. package/dist/agents.js +185 -14
  10. package/dist/built-in-actions.cjs +31 -2
  11. package/dist/built-in-actions.d.cts +27 -1
  12. package/dist/built-in-actions.d.ts +27 -1
  13. package/dist/built-in-actions.js +29 -1
  14. package/dist/client.cjs +4 -0
  15. package/dist/client.d.cts +3 -0
  16. package/dist/client.d.ts +3 -0
  17. package/dist/client.js +4 -0
  18. package/dist/code-action/define-action.cjs +2 -0
  19. package/dist/code-action/define-action.d.cts +17 -1
  20. package/dist/code-action/define-action.d.ts +17 -1
  21. package/dist/code-action/define-action.js +2 -0
  22. package/dist/code-action/index.d.cts +1 -1
  23. package/dist/code-action/index.d.ts +1 -1
  24. package/dist/code-action/types.d.cts +11 -0
  25. package/dist/code-action/types.d.ts +11 -0
  26. package/dist/index.cjs +11 -4
  27. package/dist/index.d.cts +7 -7
  28. package/dist/index.d.ts +7 -7
  29. package/dist/index.js +4 -4
  30. package/dist/oauth.cjs +18 -0
  31. package/dist/oauth.d.cts +9 -0
  32. package/dist/oauth.d.ts +9 -0
  33. package/dist/oauth.js +14 -0
  34. package/dist/projects.cjs +47 -121
  35. package/dist/projects.d.cts +5 -19
  36. package/dist/projects.d.ts +5 -19
  37. package/dist/projects.js +46 -119
  38. package/dist/schemas.cjs +27 -1
  39. package/dist/schemas.d.cts +20 -0
  40. package/dist/schemas.d.ts +20 -0
  41. package/dist/schemas.js +26 -0
  42. package/package.json +9 -9
@@ -1,6 +1,6 @@
1
1
  import { SimpleAI } from "../client.cjs";
2
2
  import { type ActionLlm } from "./llm.cjs";
3
- import type { ActionInvocationMetadata } from "./types.cjs";
3
+ import type { ActionInvocationMetadata, ActionSimulation } from "./types.cjs";
4
4
  import { type ActionDirectiveCarrier, type ActionWorkflow } from "./workflow.cjs";
5
5
  /**
6
6
  * Brand the code-action runner uses to recognize `defineAction` handlers. The
@@ -39,6 +39,12 @@ export type CustomDataTransformContext<TItem = Record<string, unknown>, TInputs
39
39
  config: Record<string, string>;
40
40
  /** What this invocation is allowed to do, decided by the use site that invoked it. */
41
41
  metadata: ActionInvocationMetadata;
42
+ /**
43
+ * Present when this invocation runs inside a simulation; null on real calls. The simulated clock
44
+ * is also installed on `Date`, so this tells you the clock is simulated rather than being the
45
+ * way to read it.
46
+ */
47
+ simulation: ActionSimulation | null;
42
48
  client: SimpleAI;
43
49
  /** Call an LLM through Simple's LLM router. */
44
50
  llm: ActionLlm;
@@ -50,6 +56,12 @@ export type ActionContext<TInputs = Record<string, unknown>> = {
50
56
  config: Record<string, string>;
51
57
  /** What this invocation is allowed to do, decided by the use site that invoked it. */
52
58
  metadata: ActionInvocationMetadata;
59
+ /**
60
+ * Present when this invocation runs inside a simulation; null on real calls. The simulated clock
61
+ * is also installed on `Date`, so this tells you the clock is simulated rather than being the
62
+ * way to read it.
63
+ */
64
+ simulation: ActionSimulation | null;
53
65
  /** The Simple AI SDK, authenticated for your organization. */
54
66
  client: SimpleAI;
55
67
  /** Ask the workflow that invoked this Action to do something, e.g. run a different node next. */
@@ -62,6 +74,8 @@ export type ActionHandler<TInputs = Record<string, unknown>, TResult = unknown>
62
74
  config: Record<string, string>;
63
75
  /** Omitted by runtimes that predate invocation metadata; the handler still receives one. */
64
76
  metadata?: ActionInvocationMetadata;
77
+ /** Omitted by runtimes that predate simulations; the handler then receives null. */
78
+ simulation?: ActionSimulation | null;
65
79
  [SIMPLE_ACTION_RUNTIME]?: ActionRuntime;
66
80
  } & ActionDirectiveCarrier) => Promise<TResult>) & {
67
81
  [SIMPLE_ACTION_BRAND]: true;
@@ -73,6 +87,8 @@ export type CustomDataTransformHandler<TItem = Record<string, unknown>, TInputs
73
87
  config: Record<string, string>;
74
88
  /** Omitted by runtimes that predate invocation metadata; the handler still receives one. */
75
89
  metadata?: ActionInvocationMetadata;
90
+ /** Omitted by runtimes that predate simulations; the handler then receives null. */
91
+ simulation?: ActionSimulation | null;
76
92
  [SIMPLE_ACTION_RUNTIME]?: ActionRuntime;
77
93
  }) => Promise<TResult>) & {
78
94
  [SIMPLE_ACTION_BRAND]: true;
@@ -1,6 +1,6 @@
1
1
  import { SimpleAI } from "../client.js";
2
2
  import { type ActionLlm } from "./llm.js";
3
- import type { ActionInvocationMetadata } from "./types.js";
3
+ import type { ActionInvocationMetadata, ActionSimulation } from "./types.js";
4
4
  import { type ActionDirectiveCarrier, type ActionWorkflow } from "./workflow.js";
5
5
  /**
6
6
  * Brand the code-action runner uses to recognize `defineAction` handlers. The
@@ -39,6 +39,12 @@ export type CustomDataTransformContext<TItem = Record<string, unknown>, TInputs
39
39
  config: Record<string, string>;
40
40
  /** What this invocation is allowed to do, decided by the use site that invoked it. */
41
41
  metadata: ActionInvocationMetadata;
42
+ /**
43
+ * Present when this invocation runs inside a simulation; null on real calls. The simulated clock
44
+ * is also installed on `Date`, so this tells you the clock is simulated rather than being the
45
+ * way to read it.
46
+ */
47
+ simulation: ActionSimulation | null;
42
48
  client: SimpleAI;
43
49
  /** Call an LLM through Simple's LLM router. */
44
50
  llm: ActionLlm;
@@ -50,6 +56,12 @@ export type ActionContext<TInputs = Record<string, unknown>> = {
50
56
  config: Record<string, string>;
51
57
  /** What this invocation is allowed to do, decided by the use site that invoked it. */
52
58
  metadata: ActionInvocationMetadata;
59
+ /**
60
+ * Present when this invocation runs inside a simulation; null on real calls. The simulated clock
61
+ * is also installed on `Date`, so this tells you the clock is simulated rather than being the
62
+ * way to read it.
63
+ */
64
+ simulation: ActionSimulation | null;
53
65
  /** The Simple AI SDK, authenticated for your organization. */
54
66
  client: SimpleAI;
55
67
  /** Ask the workflow that invoked this Action to do something, e.g. run a different node next. */
@@ -62,6 +74,8 @@ export type ActionHandler<TInputs = Record<string, unknown>, TResult = unknown>
62
74
  config: Record<string, string>;
63
75
  /** Omitted by runtimes that predate invocation metadata; the handler still receives one. */
64
76
  metadata?: ActionInvocationMetadata;
77
+ /** Omitted by runtimes that predate simulations; the handler then receives null. */
78
+ simulation?: ActionSimulation | null;
65
79
  [SIMPLE_ACTION_RUNTIME]?: ActionRuntime;
66
80
  } & ActionDirectiveCarrier) => Promise<TResult>) & {
67
81
  [SIMPLE_ACTION_BRAND]: true;
@@ -73,6 +87,8 @@ export type CustomDataTransformHandler<TItem = Record<string, unknown>, TInputs
73
87
  config: Record<string, string>;
74
88
  /** Omitted by runtimes that predate invocation metadata; the handler still receives one. */
75
89
  metadata?: ActionInvocationMetadata;
90
+ /** Omitted by runtimes that predate simulations; the handler then receives null. */
91
+ simulation?: ActionSimulation | null;
76
92
  [SIMPLE_ACTION_RUNTIME]?: ActionRuntime;
77
93
  }) => Promise<TResult>) & {
78
94
  [SIMPLE_ACTION_BRAND]: true;
@@ -41,6 +41,7 @@ export function defineAction(handler) {
41
41
  inputs,
42
42
  config,
43
43
  metadata,
44
+ simulation: invocation.simulation ?? null,
44
45
  client,
45
46
  workflow: createActionWorkflow({ metadata, carrier: invocation }),
46
47
  llm: createActionLlm({ metadata }),
@@ -64,6 +65,7 @@ export function defineCustomDataTransform(handler) {
64
65
  operation,
65
66
  config,
66
67
  metadata,
68
+ simulation: invocation.simulation ?? null,
67
69
  client,
68
70
  llm: createActionLlm({ metadata }),
69
71
  });
@@ -1,4 +1,4 @@
1
1
  export { MissingCapabilityError } from "../shared/errors.cjs";
2
2
  export { type ActionContext, type ActionHandler, type CustomDataResult, type CustomDataTransformContext, type CustomDataTransformHandler, type CustomDataTransformOperation, defineAction, defineCustomDataTransform, SIMPLE_ACTION_BRAND, } from "./define-action.cjs";
3
- export { ActionCapability, type ActionInvocationMetadata } from "./types.cjs";
3
+ export { ActionCapability, type ActionInvocationMetadata, type ActionSimulation } from "./types.cjs";
4
4
  export type { ActionWorkflow, TransitionToOptions } from "./workflow.cjs";
@@ -1,4 +1,4 @@
1
1
  export { MissingCapabilityError } from "../shared/errors.js";
2
2
  export { type ActionContext, type ActionHandler, type CustomDataResult, type CustomDataTransformContext, type CustomDataTransformHandler, type CustomDataTransformOperation, defineAction, defineCustomDataTransform, SIMPLE_ACTION_BRAND, } from "./define-action.js";
3
- export { ActionCapability, type ActionInvocationMetadata } from "./types.js";
3
+ export { ActionCapability, type ActionInvocationMetadata, type ActionSimulation } from "./types.js";
4
4
  export type { ActionWorkflow, TransitionToOptions } from "./workflow.js";
@@ -17,3 +17,14 @@ export interface ActionInvocationMetadata {
17
17
  apiKey: string;
18
18
  };
19
19
  }
20
+ /**
21
+ * Mirror of the simulation block the runtime puts on the wire — `CodeActionSimulationContext`
22
+ * in `@simple-ai-lab/shared` is the source of truth and these declarations must track it.
23
+ */
24
+ export interface ActionSimulation {
25
+ /** The simulated clock, as milliseconds added to the real clock, and the time zone it runs in. */
26
+ clock: {
27
+ offset_ms: number;
28
+ timezone: string | null;
29
+ } | null;
30
+ }
@@ -17,3 +17,14 @@ export interface ActionInvocationMetadata {
17
17
  apiKey: string;
18
18
  };
19
19
  }
20
+ /**
21
+ * Mirror of the simulation block the runtime puts on the wire — `CodeActionSimulationContext`
22
+ * in `@simple-ai-lab/shared` is the source of truth and these declarations must track it.
23
+ */
24
+ export interface ActionSimulation {
25
+ /** The simulated clock, as milliseconds added to the real clock, and the time zone it runs in. */
26
+ clock: {
27
+ offset_ms: number;
28
+ timezone: string | null;
29
+ } | null;
30
+ }
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataColumnPathSchema = exports.batchUpsertRowsSchema = exports.normalizeAgentV2CommitContent = exports.defineAgentSnapshot = exports.compileAgentProject = exports.collectActionVersionUuids = exports.DataClient = exports.ActionCapability = exports.SIMPLE_ACTION_BRAND = exports.defineCustomDataTransform = exports.defineAction = exports.SimpleAI = exports.WEB_SEARCH_OUTPUT_SCHEMA = exports.WEB_SEARCH_OUTPUT_MAPPINGS = exports.WEB_SEARCH_INPUT_SCHEMA = exports.VALIDATE_ADDRESS_OUTPUT_SCHEMA = exports.VALIDATE_ADDRESS_OUTPUT_MAPPINGS = exports.VALIDATE_ADDRESS_INPUT_SCHEMA = exports.SEND_TEXT_MESSAGE_OUTPUT_SCHEMA = exports.SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS = exports.SEND_TEXT_MESSAGE_INPUT_SCHEMA = exports.SEND_EMAIL_OUTPUT_SCHEMA = exports.SEND_EMAIL_OUTPUT_MAPPINGS = exports.SEND_EMAIL_INPUT_SCHEMA = exports.BUILT_IN_ACTION_CONTRACTS = exports.TRANSITION_FILTER_MAX_DEPTH = exports.TRANSITION_FILTER_MAX_CONDITIONS = exports.resolveExtractionFields = exports.reference = exports.prompt = exports.PII_REDACTION_CATEGORIES = exports.node = exports.MAX_CONTAINMENT_RULE_DEPTH = exports.FIVE9_SIP_BYE_HEADER_NAMES = exports.defineAgent = exports.defaultBackgroundNoise = exports.DEFAULT_TRANSITION_MESSAGE = exports.DEFAULT_PER_TURN_RETRIEVAL_TOP_K = exports.DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS = exports.DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS = exports.compileAgent = exports.canonicalAuthoringKeys = exports.canonicalAuthoringKey = exports.sourceFile = exports.resolveActionIoSchema = exports.resolveActionHttpHeaders = exports.compileAction = exports.canonicalActionSource = exports.actionsIoSchemaFromZod = exports.action = void 0;
4
- exports.SimpleAIError = exports.MissingCapabilityError = exports.tableNameSchema = exports.recordPayloadSchema = exports.queryInputSchema = exports.MAX_QUERY_SIZE = exports.MAX_BATCH_ROWS = exports.listOptionsSchema = exports.dataFilterSchema = void 0;
3
+ exports.ActionCapability = exports.SIMPLE_ACTION_BRAND = exports.defineCustomDataTransform = exports.defineAction = exports.SimpleAI = exports.WEB_SEARCH_OUTPUT_SCHEMA = exports.WEB_SEARCH_OUTPUT_MAPPINGS = exports.WEB_SEARCH_INPUT_SCHEMA = exports.VALIDATE_ADDRESS_OUTPUT_SCHEMA = exports.VALIDATE_ADDRESS_OUTPUT_MAPPINGS = exports.VALIDATE_ADDRESS_INPUT_SCHEMA = exports.SEND_TEXT_MESSAGE_OUTPUT_SCHEMA = exports.SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS = exports.SEND_TEXT_MESSAGE_INPUT_SCHEMA = exports.SEND_EMAIL_OUTPUT_SCHEMA = exports.SEND_EMAIL_OUTPUT_MAPPINGS = exports.SEND_EMAIL_INPUT_SCHEMA = exports.BUILT_IN_ACTION_CONTRACTS = exports.BROWSER_ACTION_TIMEOUT_MS_DEFAULT = exports.BROWSER_ACTION_KINDS = exports.BROWSER_ACTION_ENVIRONMENTS = exports.TRANSITION_FILTER_MAX_DEPTH = exports.TRANSITION_FILTER_MAX_CONDITIONS = exports.resolveExtractionFields = exports.reference = exports.prompt = exports.PII_REDACTION_CATEGORIES = exports.node = exports.MAX_CONTAINMENT_RULE_DEPTH = exports.GUARDRAIL_MODES = exports.FIVE9_SIP_BYE_HEADER_NAMES = exports.defineAgent = exports.defaultBackgroundNoise = exports.DEFAULT_TRANSITION_MESSAGE = exports.DEFAULT_PER_TURN_RETRIEVAL_TOP_K = exports.DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS = exports.DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS = exports.compileAgent = exports.canonicalAuthoringKeys = exports.canonicalAuthoringKey = exports.CALL_END_ACTION_KEY = exports.BEFORE_CALL_ACTION_KEY = exports.assistActionRunKey = exports.sourceFile = exports.resolveActionIoSchema = exports.resolveActionHttpHeaders = exports.compileAction = exports.canonicalActionSource = exports.actionsIoSchemaFromZod = exports.action = void 0;
4
+ exports.SimpleAIError = exports.MissingCapabilityError = exports.tableNameSchema = exports.recordPayloadSchema = exports.queryInputSchema = exports.MAX_QUERY_SIZE = exports.MAX_BATCH_ROWS = exports.listOptionsSchema = exports.dataFilterSchema = exports.dataColumnPathSchema = exports.clientCredentialsTokenInputSchema = exports.batchUpsertRowsSchema = exports.normalizeAgentV2CommitContent = exports.collectActionVersionUuids = exports.assistActionUseSites = exports.DataClient = void 0;
5
5
  var actions_1 = require("./actions.cjs");
6
6
  Object.defineProperty(exports, "action", { enumerable: true, get: function () { return actions_1.action; } });
7
7
  Object.defineProperty(exports, "actionsIoSchemaFromZod", { enumerable: true, get: function () { return actions_1.actionsIoSchemaFromZod; } });
@@ -11,6 +11,9 @@ Object.defineProperty(exports, "resolveActionHttpHeaders", { enumerable: true, g
11
11
  Object.defineProperty(exports, "resolveActionIoSchema", { enumerable: true, get: function () { return actions_1.resolveActionIoSchema; } });
12
12
  Object.defineProperty(exports, "sourceFile", { enumerable: true, get: function () { return actions_1.sourceFile; } });
13
13
  var agents_1 = require("./agents.cjs");
14
+ Object.defineProperty(exports, "assistActionRunKey", { enumerable: true, get: function () { return agents_1.assistActionRunKey; } });
15
+ Object.defineProperty(exports, "BEFORE_CALL_ACTION_KEY", { enumerable: true, get: function () { return agents_1.BEFORE_CALL_ACTION_KEY; } });
16
+ Object.defineProperty(exports, "CALL_END_ACTION_KEY", { enumerable: true, get: function () { return agents_1.CALL_END_ACTION_KEY; } });
14
17
  Object.defineProperty(exports, "canonicalAuthoringKey", { enumerable: true, get: function () { return agents_1.canonicalAuthoringKey; } });
15
18
  Object.defineProperty(exports, "canonicalAuthoringKeys", { enumerable: true, get: function () { return agents_1.canonicalAuthoringKeys; } });
16
19
  Object.defineProperty(exports, "compileAgent", { enumerable: true, get: function () { return agents_1.compileAgent; } });
@@ -21,6 +24,7 @@ Object.defineProperty(exports, "DEFAULT_TRANSITION_MESSAGE", { enumerable: true,
21
24
  Object.defineProperty(exports, "defaultBackgroundNoise", { enumerable: true, get: function () { return agents_1.defaultBackgroundNoise; } });
22
25
  Object.defineProperty(exports, "defineAgent", { enumerable: true, get: function () { return agents_1.defineAgent; } });
23
26
  Object.defineProperty(exports, "FIVE9_SIP_BYE_HEADER_NAMES", { enumerable: true, get: function () { return agents_1.FIVE9_SIP_BYE_HEADER_NAMES; } });
27
+ Object.defineProperty(exports, "GUARDRAIL_MODES", { enumerable: true, get: function () { return agents_1.GUARDRAIL_MODES; } });
24
28
  Object.defineProperty(exports, "MAX_CONTAINMENT_RULE_DEPTH", { enumerable: true, get: function () { return agents_1.MAX_CONTAINMENT_RULE_DEPTH; } });
25
29
  Object.defineProperty(exports, "node", { enumerable: true, get: function () { return agents_1.node; } });
26
30
  Object.defineProperty(exports, "PII_REDACTION_CATEGORIES", { enumerable: true, get: function () { return agents_1.PII_REDACTION_CATEGORIES; } });
@@ -30,6 +34,9 @@ Object.defineProperty(exports, "resolveExtractionFields", { enumerable: true, ge
30
34
  Object.defineProperty(exports, "TRANSITION_FILTER_MAX_CONDITIONS", { enumerable: true, get: function () { return agents_1.TRANSITION_FILTER_MAX_CONDITIONS; } });
31
35
  Object.defineProperty(exports, "TRANSITION_FILTER_MAX_DEPTH", { enumerable: true, get: function () { return agents_1.TRANSITION_FILTER_MAX_DEPTH; } });
32
36
  var built_in_actions_1 = require("./built-in-actions.cjs");
37
+ Object.defineProperty(exports, "BROWSER_ACTION_ENVIRONMENTS", { enumerable: true, get: function () { return built_in_actions_1.BROWSER_ACTION_ENVIRONMENTS; } });
38
+ Object.defineProperty(exports, "BROWSER_ACTION_KINDS", { enumerable: true, get: function () { return built_in_actions_1.BROWSER_ACTION_KINDS; } });
39
+ Object.defineProperty(exports, "BROWSER_ACTION_TIMEOUT_MS_DEFAULT", { enumerable: true, get: function () { return built_in_actions_1.BROWSER_ACTION_TIMEOUT_MS_DEFAULT; } });
33
40
  Object.defineProperty(exports, "BUILT_IN_ACTION_CONTRACTS", { enumerable: true, get: function () { return built_in_actions_1.BUILT_IN_ACTION_CONTRACTS; } });
34
41
  Object.defineProperty(exports, "SEND_EMAIL_INPUT_SCHEMA", { enumerable: true, get: function () { return built_in_actions_1.SEND_EMAIL_INPUT_SCHEMA; } });
35
42
  Object.defineProperty(exports, "SEND_EMAIL_OUTPUT_MAPPINGS", { enumerable: true, get: function () { return built_in_actions_1.SEND_EMAIL_OUTPUT_MAPPINGS; } });
@@ -54,12 +61,12 @@ Object.defineProperty(exports, "ActionCapability", { enumerable: true, get: func
54
61
  var data_1 = require("./data.cjs");
55
62
  Object.defineProperty(exports, "DataClient", { enumerable: true, get: function () { return data_1.DataClient; } });
56
63
  var projects_1 = require("./projects.cjs");
64
+ Object.defineProperty(exports, "assistActionUseSites", { enumerable: true, get: function () { return projects_1.assistActionUseSites; } });
57
65
  Object.defineProperty(exports, "collectActionVersionUuids", { enumerable: true, get: function () { return projects_1.collectActionVersionUuids; } });
58
- Object.defineProperty(exports, "compileAgentProject", { enumerable: true, get: function () { return projects_1.compileAgentProject; } });
59
- Object.defineProperty(exports, "defineAgentSnapshot", { enumerable: true, get: function () { return projects_1.defineAgentSnapshot; } });
60
66
  Object.defineProperty(exports, "normalizeAgentV2CommitContent", { enumerable: true, get: function () { return projects_1.normalizeAgentV2CommitContent; } });
61
67
  var schemas_1 = require("./schemas.cjs");
62
68
  Object.defineProperty(exports, "batchUpsertRowsSchema", { enumerable: true, get: function () { return schemas_1.batchUpsertRowsSchema; } });
69
+ Object.defineProperty(exports, "clientCredentialsTokenInputSchema", { enumerable: true, get: function () { return schemas_1.clientCredentialsTokenInputSchema; } });
63
70
  Object.defineProperty(exports, "dataColumnPathSchema", { enumerable: true, get: function () { return schemas_1.dataColumnPathSchema; } });
64
71
  Object.defineProperty(exports, "dataFilterSchema", { enumerable: true, get: function () { return schemas_1.dataFilterSchema; } });
65
72
  Object.defineProperty(exports, "listOptionsSchema", { enumerable: true, get: function () { return schemas_1.listOptionsSchema; } });
package/dist/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- export { type ActionCompileOptions, type ActionDefinition, type ActionHttpHeaders, type ActionIoInput, type ActionOutputParameterMappings, type ActionOutputParameters, type ActionRunDefinition, type ActionsIoSchema, type ActionsIoSchemaNode, type ActionVersionValues, type AgentActionInput, action, actionsIoSchemaFromZod, type BackgroundMessage, type BuiltInActionValues, type BuiltInOperation, type CallableActionDefinition, canonicalActionSource, compileAction, type InlineActionDefinition, type ReferencedActionDefinition, resolveActionHttpHeaders, resolveActionIoSchema, type SourceFileReference, sourceFile, } from "./actions.cjs";
2
- export { type AbTestNodeDefinition, type ActionNodeDefinition, type AgentCompileOptions, type AgentDefinition, type AgentDefinitionInput, type AgentIdentityKind, type AgentV2CommitContentWire, type AgentV2ConfigWire, type AgentV2EdgeWire, type AgentV2NodeWire, type AlwaysAvailableCapability, type AlwaysAvailableTransitionFilterWire, type BackgroundNoise, type BackgroundNoiseConfig, type CallParameterFilter, type CartActionRef, type CartCheckoutDefinition, type CartCheckoutWhenWire, type CartConfigWire, type CartDefinition, type CartPointer, type CartSummaryLineWire, type CartViewWire, type CheckInAfterSilence, type CheckInAfterSilenceInput, type CollectCreditCardNodeDefinition, type CompiledAgentProject, type ContainableCondition, type ContainableRuleGroup, type ContainableRuleSet, type ContainedCondition, type ContainedRuleGroup, type ContainedRuleSet, type ContainmentConfig, type ContainmentEndedByCondition, type ContainmentParameterCondition, type ContainmentTagCondition, type ContainmentVisitedNodeCondition, canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, type EdgeDefinition, type EnabledWithDescription, type EndCallNodeDefinition, type EotEagerness, type ExtractionField, type ExtractionInput, type ExtractNodeDefinition, FIVE9_SIP_BYE_HEADER_NAMES, type Five9SipByeHeaderName, type GeneratedExamples, type GeneratedExamplesPolicy, type GlobalNodeDefinition, type HttpNodeDefinition, type InterruptionEagerness, type LlmOverrideDefinition, type LlmOverrideWire, MAX_CONTAINMENT_RULE_DEPTH, type NodeDefinition, node, type ParameterUpdate, type PerTurnRetrievalDefinition, type PerTurnRetrievalWire, PII_REDACTION_CATEGORIES, type PiiRedactionCategory, type PiiRedactionConfig, type PromptExample, type PromptNodeDefinition, type PromptReference, type Pronunciation, prompt, type RemoteReference, reference, resolveExtractionFields, type SayNodeDefinition, type SopGlobalContext, type SopSection, type SopSectionEdge, type SopSpec, type SopToolRef, type StaticRouterNodeDefinition, type ToolUseSiteWire, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, type TransferCapability, type TransferChatNodeDefinition, type TransferNodeDefinition, type TransitionFilter, type TransitionFilterCondition, type TransitionFilterJs, type TransitionFilterValue, type TransitionFilterWire, type TransitionMessageWire, type UpdateParametersNodeDefinition, } from "./agents.cjs";
3
- export { BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.cjs";
1
+ export { type ActionCompileOptions, type ActionDefinition, type ActionHttpHeaders, type ActionInputLabel, type ActionIoInput, type ActionOutputParameterMappings, type ActionOutputParameters, type ActionRunDefinition, type ActionsIoSchema, type ActionsIoSchemaNode, type ActionVersionValues, type AgentActionInput, action, actionsIoSchemaFromZod, type BackgroundMessage, type BuiltInActionValues, type BuiltInOperation, type CallableActionDefinition, canonicalActionSource, compileAction, type InlineActionDefinition, type ReferencedActionDefinition, resolveActionHttpHeaders, resolveActionIoSchema, type SensitiveInputScope, type SourceFileReference, sourceFile, } from "./actions.cjs";
2
+ export { type AbTestNodeDefinition, type ActionNodeDefinition, type AgentCompileOptions, type AgentDefinition, type AgentDefinitionInput, type AgentIdentityKind, type AgentModality, type AgentV2CommitContentWire, type AgentV2ConfigWire, type AgentV2EdgeWire, type AgentV2NodeWire, type AlwaysAvailableCapability, type AlwaysAvailableTransitionFilterWire, type AssistActionUseSiteWire, type AssistCardButtonDefinition, type AssistCardButtonWire, type AssistCardDefinition, type AssistCardWire, type AssistChecklistDefinition, type AssistChecklistWire, type AssistMomentTriggerWire, type AssistPlaybookConfigWire, type AssistPlaybookDefinition, type AssistProcedureDefinition, type AssistProcedureHookWire, type AssistProcedureStepDefinition, type AssistProcedureStepWire, type AssistProcedureWire, assistActionRunKey, type BackgroundNoise, type BackgroundNoiseConfig, BEFORE_CALL_ACTION_KEY, CALL_END_ACTION_KEY, type CallParameterFilter, type CartActionRef, type CartCheckoutDefinition, type CartCheckoutWhenWire, type CartConfigWire, type CartDefinition, type CartPointer, type CartSummaryLineWire, type CartViewWire, type CheckInAfterSilence, type CheckInAfterSilenceInput, type CollectCreditCardNodeDefinition, type CompiledAgentProject, type ConditionOperator, type ContainableCondition, type ContainableRuleGroup, type ContainableRuleSet, type ContainedCondition, type ContainedRuleGroup, type ContainedRuleSet, type ContainmentConfig, type ContainmentEndedByCondition, type ContainmentParameterCondition, type ContainmentTagCondition, type ContainmentVisitedNodeCondition, canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, type EdgeDefinition, type EnabledWithDescription, type EndCallNodeDefinition, type EotEagerness, type ExtractionField, type ExtractionInput, type ExtractNodeDefinition, FIVE9_SIP_BYE_HEADER_NAMES, type Five9SipByeHeaderName, type GeneratedExamples, type GeneratedExamplesPolicy, type GlobalNodeDefinition, GUARDRAIL_MODES, type GuardrailAssignmentDefinition, type GuardrailAssignmentWire, type GuardrailMode, type HttpNodeDefinition, type InterruptionEagerness, type LlmOverrideDefinition, type LlmOverrideWire, MAX_CONTAINMENT_RULE_DEPTH, type NodeDefinition, node, type ParameterUpdate, type PerTurnRetrievalDefinition, type PerTurnRetrievalWire, PII_REDACTION_CATEGORIES, type PiiRedactionCategory, type PiiRedactionConfig, type PromptExample, type PromptNodeDefinition, type PromptReference, type Pronunciation, prompt, type RemoteReference, reference, resolveExtractionFields, type SayNodeDefinition, type SopGlobalContext, type SopSection, type SopSectionEdge, type SopSpec, type SopToolRef, type StaticRouterNodeDefinition, type ToolUseSiteWire, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, type TransferCapability, type TransferChatNodeDefinition, type TransferNodeDefinition, type TransitionFilter, type TransitionFilterCondition, type TransitionFilterJs, type TransitionFilterValue, type TransitionFilterWire, type TransitionMessageWire, type UpdateParametersNodeDefinition, } from "./agents.cjs";
3
+ export { BROWSER_ACTION_ENVIRONMENTS, BROWSER_ACTION_KINDS, BROWSER_ACTION_TIMEOUT_MS_DEFAULT, BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.cjs";
4
4
  export { SimpleAI, type SimpleAIOptions } from "./client.cjs";
5
5
  export { type ActionContext, type ActionHandler, type CustomDataResult, type CustomDataTransformContext, type CustomDataTransformHandler, type CustomDataTransformOperation, defineAction, defineCustomDataTransform, SIMPLE_ACTION_BRAND, } from "./code-action/define-action.cjs";
6
- export { ActionCapability, type ActionInvocationMetadata } from "./code-action/types.cjs";
6
+ export { ActionCapability, type ActionInvocationMetadata, type ActionSimulation } from "./code-action/types.cjs";
7
7
  export type { ActionWorkflow, TransitionToOptions } from "./code-action/workflow.cjs";
8
8
  export { DataClient } from "./data.cjs";
9
- export { type AgentProjectSource, type AgentSnapshotDefinition, collectActionVersionUuids, compileAgentProject, defineAgentSnapshot, normalizeAgentV2CommitContent, type SnapshotAction, } from "./projects.cjs";
10
- export type { BatchUpsertResult, DataFilter, DataRecord, DeleteResult, FacetsResult, IngestBatchStatus, ListOptions, ListResult, QueryInput, QueryResult, RecordPayload, RecordResult, } from "./schemas.cjs";
11
- export { batchUpsertRowsSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.cjs";
9
+ export { assistActionUseSites, collectActionVersionUuids, normalizeAgentV2CommitContent } from "./projects.cjs";
10
+ export type { BatchUpsertResult, ClientCredentialsToken, ClientCredentialsTokenInput, DataFilter, DataRecord, DeleteResult, FacetsResult, IngestBatchStatus, ListOptions, ListResult, QueryInput, QueryResult, RecordPayload, RecordResult, } from "./schemas.cjs";
11
+ export { batchUpsertRowsSchema, clientCredentialsTokenInputSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.cjs";
12
12
  export { MissingCapabilityError, SimpleAIError } from "./shared/errors.cjs";
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { type ActionCompileOptions, type ActionDefinition, type ActionHttpHeaders, type ActionIoInput, type ActionOutputParameterMappings, type ActionOutputParameters, type ActionRunDefinition, type ActionsIoSchema, type ActionsIoSchemaNode, type ActionVersionValues, type AgentActionInput, action, actionsIoSchemaFromZod, type BackgroundMessage, type BuiltInActionValues, type BuiltInOperation, type CallableActionDefinition, canonicalActionSource, compileAction, type InlineActionDefinition, type ReferencedActionDefinition, resolveActionHttpHeaders, resolveActionIoSchema, type SourceFileReference, sourceFile, } from "./actions.js";
2
- export { type AbTestNodeDefinition, type ActionNodeDefinition, type AgentCompileOptions, type AgentDefinition, type AgentDefinitionInput, type AgentIdentityKind, type AgentV2CommitContentWire, type AgentV2ConfigWire, type AgentV2EdgeWire, type AgentV2NodeWire, type AlwaysAvailableCapability, type AlwaysAvailableTransitionFilterWire, type BackgroundNoise, type BackgroundNoiseConfig, type CallParameterFilter, type CartActionRef, type CartCheckoutDefinition, type CartCheckoutWhenWire, type CartConfigWire, type CartDefinition, type CartPointer, type CartSummaryLineWire, type CartViewWire, type CheckInAfterSilence, type CheckInAfterSilenceInput, type CollectCreditCardNodeDefinition, type CompiledAgentProject, type ContainableCondition, type ContainableRuleGroup, type ContainableRuleSet, type ContainedCondition, type ContainedRuleGroup, type ContainedRuleSet, type ContainmentConfig, type ContainmentEndedByCondition, type ContainmentParameterCondition, type ContainmentTagCondition, type ContainmentVisitedNodeCondition, canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, type EdgeDefinition, type EnabledWithDescription, type EndCallNodeDefinition, type EotEagerness, type ExtractionField, type ExtractionInput, type ExtractNodeDefinition, FIVE9_SIP_BYE_HEADER_NAMES, type Five9SipByeHeaderName, type GeneratedExamples, type GeneratedExamplesPolicy, type GlobalNodeDefinition, type HttpNodeDefinition, type InterruptionEagerness, type LlmOverrideDefinition, type LlmOverrideWire, MAX_CONTAINMENT_RULE_DEPTH, type NodeDefinition, node, type ParameterUpdate, type PerTurnRetrievalDefinition, type PerTurnRetrievalWire, PII_REDACTION_CATEGORIES, type PiiRedactionCategory, type PiiRedactionConfig, type PromptExample, type PromptNodeDefinition, type PromptReference, type Pronunciation, prompt, type RemoteReference, reference, resolveExtractionFields, type SayNodeDefinition, type SopGlobalContext, type SopSection, type SopSectionEdge, type SopSpec, type SopToolRef, type StaticRouterNodeDefinition, type ToolUseSiteWire, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, type TransferCapability, type TransferChatNodeDefinition, type TransferNodeDefinition, type TransitionFilter, type TransitionFilterCondition, type TransitionFilterJs, type TransitionFilterValue, type TransitionFilterWire, type TransitionMessageWire, type UpdateParametersNodeDefinition, } from "./agents.js";
3
- export { BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.js";
1
+ export { type ActionCompileOptions, type ActionDefinition, type ActionHttpHeaders, type ActionInputLabel, type ActionIoInput, type ActionOutputParameterMappings, type ActionOutputParameters, type ActionRunDefinition, type ActionsIoSchema, type ActionsIoSchemaNode, type ActionVersionValues, type AgentActionInput, action, actionsIoSchemaFromZod, type BackgroundMessage, type BuiltInActionValues, type BuiltInOperation, type CallableActionDefinition, canonicalActionSource, compileAction, type InlineActionDefinition, type ReferencedActionDefinition, resolveActionHttpHeaders, resolveActionIoSchema, type SensitiveInputScope, type SourceFileReference, sourceFile, } from "./actions.js";
2
+ export { type AbTestNodeDefinition, type ActionNodeDefinition, type AgentCompileOptions, type AgentDefinition, type AgentDefinitionInput, type AgentIdentityKind, type AgentModality, type AgentV2CommitContentWire, type AgentV2ConfigWire, type AgentV2EdgeWire, type AgentV2NodeWire, type AlwaysAvailableCapability, type AlwaysAvailableTransitionFilterWire, type AssistActionUseSiteWire, type AssistCardButtonDefinition, type AssistCardButtonWire, type AssistCardDefinition, type AssistCardWire, type AssistChecklistDefinition, type AssistChecklistWire, type AssistMomentTriggerWire, type AssistPlaybookConfigWire, type AssistPlaybookDefinition, type AssistProcedureDefinition, type AssistProcedureHookWire, type AssistProcedureStepDefinition, type AssistProcedureStepWire, type AssistProcedureWire, assistActionRunKey, type BackgroundNoise, type BackgroundNoiseConfig, BEFORE_CALL_ACTION_KEY, CALL_END_ACTION_KEY, type CallParameterFilter, type CartActionRef, type CartCheckoutDefinition, type CartCheckoutWhenWire, type CartConfigWire, type CartDefinition, type CartPointer, type CartSummaryLineWire, type CartViewWire, type CheckInAfterSilence, type CheckInAfterSilenceInput, type CollectCreditCardNodeDefinition, type CompiledAgentProject, type ConditionOperator, type ContainableCondition, type ContainableRuleGroup, type ContainableRuleSet, type ContainedCondition, type ContainedRuleGroup, type ContainedRuleSet, type ContainmentConfig, type ContainmentEndedByCondition, type ContainmentParameterCondition, type ContainmentTagCondition, type ContainmentVisitedNodeCondition, canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, type EdgeDefinition, type EnabledWithDescription, type EndCallNodeDefinition, type EotEagerness, type ExtractionField, type ExtractionInput, type ExtractNodeDefinition, FIVE9_SIP_BYE_HEADER_NAMES, type Five9SipByeHeaderName, type GeneratedExamples, type GeneratedExamplesPolicy, type GlobalNodeDefinition, GUARDRAIL_MODES, type GuardrailAssignmentDefinition, type GuardrailAssignmentWire, type GuardrailMode, type HttpNodeDefinition, type InterruptionEagerness, type LlmOverrideDefinition, type LlmOverrideWire, MAX_CONTAINMENT_RULE_DEPTH, type NodeDefinition, node, type ParameterUpdate, type PerTurnRetrievalDefinition, type PerTurnRetrievalWire, PII_REDACTION_CATEGORIES, type PiiRedactionCategory, type PiiRedactionConfig, type PromptExample, type PromptNodeDefinition, type PromptReference, type Pronunciation, prompt, type RemoteReference, reference, resolveExtractionFields, type SayNodeDefinition, type SopGlobalContext, type SopSection, type SopSectionEdge, type SopSpec, type SopToolRef, type StaticRouterNodeDefinition, type ToolUseSiteWire, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, type TransferCapability, type TransferChatNodeDefinition, type TransferNodeDefinition, type TransitionFilter, type TransitionFilterCondition, type TransitionFilterJs, type TransitionFilterValue, type TransitionFilterWire, type TransitionMessageWire, type UpdateParametersNodeDefinition, } from "./agents.js";
3
+ export { BROWSER_ACTION_ENVIRONMENTS, BROWSER_ACTION_KINDS, BROWSER_ACTION_TIMEOUT_MS_DEFAULT, BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.js";
4
4
  export { SimpleAI, type SimpleAIOptions } from "./client.js";
5
5
  export { type ActionContext, type ActionHandler, type CustomDataResult, type CustomDataTransformContext, type CustomDataTransformHandler, type CustomDataTransformOperation, defineAction, defineCustomDataTransform, SIMPLE_ACTION_BRAND, } from "./code-action/define-action.js";
6
- export { ActionCapability, type ActionInvocationMetadata } from "./code-action/types.js";
6
+ export { ActionCapability, type ActionInvocationMetadata, type ActionSimulation } from "./code-action/types.js";
7
7
  export type { ActionWorkflow, TransitionToOptions } from "./code-action/workflow.js";
8
8
  export { DataClient } from "./data.js";
9
- export { type AgentProjectSource, type AgentSnapshotDefinition, collectActionVersionUuids, compileAgentProject, defineAgentSnapshot, normalizeAgentV2CommitContent, type SnapshotAction, } from "./projects.js";
10
- export type { BatchUpsertResult, DataFilter, DataRecord, DeleteResult, FacetsResult, IngestBatchStatus, ListOptions, ListResult, QueryInput, QueryResult, RecordPayload, RecordResult, } from "./schemas.js";
11
- export { batchUpsertRowsSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.js";
9
+ export { assistActionUseSites, collectActionVersionUuids, normalizeAgentV2CommitContent } from "./projects.js";
10
+ export type { BatchUpsertResult, ClientCredentialsToken, ClientCredentialsTokenInput, DataFilter, DataRecord, DeleteResult, FacetsResult, IngestBatchStatus, ListOptions, ListResult, QueryInput, QueryResult, RecordPayload, RecordResult, } from "./schemas.js";
11
+ export { batchUpsertRowsSchema, clientCredentialsTokenInputSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.js";
12
12
  export { MissingCapabilityError, SimpleAIError } from "./shared/errors.js";
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export { action, actionsIoSchemaFromZod, canonicalActionSource, compileAction, resolveActionHttpHeaders, resolveActionIoSchema, sourceFile, } from "./actions.js";
2
- export { canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, FIVE9_SIP_BYE_HEADER_NAMES, MAX_CONTAINMENT_RULE_DEPTH, node, PII_REDACTION_CATEGORIES, prompt, reference, resolveExtractionFields, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, } from "./agents.js";
3
- export { BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.js";
2
+ export { assistActionRunKey, BEFORE_CALL_ACTION_KEY, CALL_END_ACTION_KEY, canonicalAuthoringKey, canonicalAuthoringKeys, compileAgent, DEFAULT_CHECK_IN_AFTER_SILENCE_DELAY_SECONDS, DEFAULT_PER_TURN_RETRIEVAL_RECENT_TURNS, DEFAULT_PER_TURN_RETRIEVAL_TOP_K, DEFAULT_TRANSITION_MESSAGE, defaultBackgroundNoise, defineAgent, FIVE9_SIP_BYE_HEADER_NAMES, GUARDRAIL_MODES, MAX_CONTAINMENT_RULE_DEPTH, node, PII_REDACTION_CATEGORIES, prompt, reference, resolveExtractionFields, TRANSITION_FILTER_MAX_CONDITIONS, TRANSITION_FILTER_MAX_DEPTH, } from "./agents.js";
3
+ export { BROWSER_ACTION_ENVIRONMENTS, BROWSER_ACTION_KINDS, BROWSER_ACTION_TIMEOUT_MS_DEFAULT, BUILT_IN_ACTION_CONTRACTS, SEND_EMAIL_INPUT_SCHEMA, SEND_EMAIL_OUTPUT_MAPPINGS, SEND_EMAIL_OUTPUT_SCHEMA, SEND_TEXT_MESSAGE_INPUT_SCHEMA, SEND_TEXT_MESSAGE_OUTPUT_MAPPINGS, SEND_TEXT_MESSAGE_OUTPUT_SCHEMA, VALIDATE_ADDRESS_INPUT_SCHEMA, VALIDATE_ADDRESS_OUTPUT_MAPPINGS, VALIDATE_ADDRESS_OUTPUT_SCHEMA, WEB_SEARCH_INPUT_SCHEMA, WEB_SEARCH_OUTPUT_MAPPINGS, WEB_SEARCH_OUTPUT_SCHEMA, } from "./built-in-actions.js";
4
4
  export { SimpleAI } from "./client.js";
5
5
  export { defineAction, defineCustomDataTransform, SIMPLE_ACTION_BRAND, } from "./code-action/define-action.js";
6
6
  export { ActionCapability } from "./code-action/types.js";
7
7
  export { DataClient } from "./data.js";
8
- export { collectActionVersionUuids, compileAgentProject, defineAgentSnapshot, normalizeAgentV2CommitContent, } from "./projects.js";
9
- export { batchUpsertRowsSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.js";
8
+ export { assistActionUseSites, collectActionVersionUuids, normalizeAgentV2CommitContent } from "./projects.js";
9
+ export { batchUpsertRowsSchema, clientCredentialsTokenInputSchema, dataColumnPathSchema, dataFilterSchema, listOptionsSchema, MAX_BATCH_ROWS, MAX_QUERY_SIZE, queryInputSchema, recordPayloadSchema, tableNameSchema, } from "./schemas.js";
10
10
  export { MissingCapabilityError, SimpleAIError } from "./shared/errors.js";
package/dist/oauth.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OAuthClient = void 0;
4
+ const schemas_1 = require("./schemas.cjs");
5
+ /** OAuth 2.0 access tokens for calling your own systems, via `/api/v1/oauth_tokens`. */
6
+ class OAuthClient {
7
+ #http;
8
+ constructor(http) {
9
+ this.#http = http;
10
+ }
11
+ /** Reused across runs until shortly before expiry; pass `forceRefresh: true` when the token is rejected. */
12
+ async clientCredentials(input) {
13
+ const parsed = schemas_1.clientCredentialsTokenInputSchema.parse(input);
14
+ const result = await this.#http.request({ method: 'POST', path: '/oauth_tokens/client_credentials', body: parsed });
15
+ return schemas_1.clientCredentialsTokenSchema.parse(result);
16
+ }
17
+ }
18
+ exports.OAuthClient = OAuthClient;
@@ -0,0 +1,9 @@
1
+ import type { HttpClient } from "./http.cjs";
2
+ import { type ClientCredentialsToken, type ClientCredentialsTokenInput } from "./schemas.cjs";
3
+ /** OAuth 2.0 access tokens for calling your own systems, via `/api/v1/oauth_tokens`. */
4
+ export declare class OAuthClient {
5
+ #private;
6
+ constructor(http: HttpClient);
7
+ /** Reused across runs until shortly before expiry; pass `forceRefresh: true` when the token is rejected. */
8
+ clientCredentials(input: ClientCredentialsTokenInput): Promise<ClientCredentialsToken>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { HttpClient } from "./http.js";
2
+ import { type ClientCredentialsToken, type ClientCredentialsTokenInput } from "./schemas.js";
3
+ /** OAuth 2.0 access tokens for calling your own systems, via `/api/v1/oauth_tokens`. */
4
+ export declare class OAuthClient {
5
+ #private;
6
+ constructor(http: HttpClient);
7
+ /** Reused across runs until shortly before expiry; pass `forceRefresh: true` when the token is rejected. */
8
+ clientCredentials(input: ClientCredentialsTokenInput): Promise<ClientCredentialsToken>;
9
+ }
package/dist/oauth.js ADDED
@@ -0,0 +1,14 @@
1
+ import { clientCredentialsTokenInputSchema, clientCredentialsTokenSchema, } from "./schemas.js";
2
+ /** OAuth 2.0 access tokens for calling your own systems, via `/api/v1/oauth_tokens`. */
3
+ export class OAuthClient {
4
+ #http;
5
+ constructor(http) {
6
+ this.#http = http;
7
+ }
8
+ /** Reused across runs until shortly before expiry; pass `forceRefresh: true` when the token is rejected. */
9
+ async clientCredentials(input) {
10
+ const parsed = clientCredentialsTokenInputSchema.parse(input);
11
+ const result = await this.#http.request({ method: 'POST', path: '/oauth_tokens/client_credentials', body: parsed });
12
+ return clientCredentialsTokenSchema.parse(result);
13
+ }
14
+ }
package/dist/projects.cjs CHANGED
@@ -1,13 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineAgentSnapshot = defineAgentSnapshot;
4
3
  exports.normalizeAgentV2CommitContent = normalizeAgentV2CommitContent;
5
- exports.compileAgentProject = compileAgentProject;
6
4
  exports.collectActionVersionUuids = collectActionVersionUuids;
7
- const agents_1 = require("./agents.cjs");
8
- function defineAgentSnapshot(definition) {
9
- return { kind: 'agent-snapshot', ...definition };
10
- }
5
+ exports.assistActionUseSites = assistActionUseSites;
11
6
  function normalizeNodeCompatibilityDefaults(node) {
12
7
  // Commits predating a setting omit its key. The server declares each with a
13
8
  // default (`{}` for SIP headers, `null` for a shared extraction Schema), so
@@ -19,6 +14,11 @@ function normalizeNodeCompatibilityDefaults(node) {
19
14
  if (typed.type === 'extract' && typed.schemaUuid === undefined) {
20
15
  typed = { ...typed, schemaUuid: null };
21
16
  }
17
+ // No override normalizes to a node written before overrides existed, the shape older locks hashed.
18
+ if (typed.type === 'extract' && typed.overrides?.llm === undefined) {
19
+ const { overrides: _noOverride, ...withoutOverrides } = typed;
20
+ typed = withoutOverrides;
21
+ }
22
22
  // A chat transfer is the one node whose execution message has no default, so
23
23
  // absent survives a parse. The call serializer reads it as `?? null`, which
24
24
  // makes the two the same value to everything downstream.
@@ -47,7 +47,11 @@ function normalizePromptDefaults(node) {
47
47
  function normalizeSharedNodeDefaults(untypedNode) {
48
48
  const node = normalizePromptDefaults(untypedNode);
49
49
  const normalizedEdges = node.edges.map((edge) => (edge.filter === undefined ? { ...edge, filter: null } : edge));
50
- const alwaysAvailable = node.builtInTools?.alwaysAvailable;
50
+ // The global, update-parameters and collect-credit-card nodes have no capabilities.
51
+ if (!('builtInTools' in node)) {
52
+ return { ...node, edges: normalizedEdges };
53
+ }
54
+ const alwaysAvailable = node.builtInTools.alwaysAvailable;
51
55
  if (alwaysAvailable === undefined || alwaysAvailable.filter !== undefined) {
52
56
  return { ...node, edges: normalizedEdges };
53
57
  }
@@ -76,15 +80,16 @@ function normalizeSharedNodeDefaults(untypedNode) {
76
80
  }
77
81
  /**
78
82
  * Fills defaults added after older Agent commits were stored. Pull, diff, and
79
- * snapshot compilation must all use this same canonical content shape so a
80
- * freshly pulled project is clean against its lock.
83
+ * pull verification must all use this same canonical content shape so a freshly
84
+ * pulled project is clean against its lock.
81
85
  */
82
86
  function normalizeAgentV2CommitContent(content) {
87
+ const { guardrails, nodeCheck, ...config } = content.config;
83
88
  return {
84
89
  ...content,
85
90
  nodes: content.nodes.map(normalizeNodeCompatibilityDefaults),
86
91
  config: {
87
- ...content.config,
92
+ ...config,
88
93
  speech: {
89
94
  ...content.config.speech,
90
95
  voiceFormattingEnabled: content.config.speech.voiceFormattingEnabled ?? false,
@@ -96,16 +101,28 @@ function normalizeAgentV2CommitContent(content) {
96
101
  // the organization.
97
102
  piiRedaction: content.config.call.piiRedaction ?? null,
98
103
  },
104
+ // The server declares a `null` default for the call-end Action, so a commit
105
+ // without one means the same as one storing null.
106
+ automaticActions: {
107
+ ...content.config.automaticActions,
108
+ callEnd: content.config.automaticActions.callEnd ?? null,
109
+ },
99
110
  // The server declares a `null` default for the background message, so a
100
- // commit that predates the field means the same as one storing null.
111
+ // commit that predates the field means the same as one storing null. An
112
+ // empty `inputLabels` means the same as none, which is how compile writes it.
101
113
  ...(content.config.toolUseSites === undefined
102
114
  ? {}
103
115
  : {
104
- toolUseSites: content.config.toolUseSites.map((useSite) => ({
116
+ toolUseSites: content.config.toolUseSites.map(({ inputLabels, ...useSite }) => ({
105
117
  ...useSite,
118
+ ...(inputLabels === undefined || Object.keys(inputLabels).length === 0 ? {} : { inputLabels }),
106
119
  backgroundMessage: useSite.backgroundMessage ?? null,
107
120
  })),
108
121
  }),
122
+ // Defaults normalize to a commit written before the field, which is what a lock written then hashed, so an
123
+ // upgrade does not report a pristine project as changed.
124
+ ...(guardrails === undefined || guardrails.length === 0 ? {} : { guardrails }),
125
+ ...(nodeCheck?.enabled === true ? { nodeCheck } : {}),
109
126
  // `toneGuidelines` and `checkInAfterSilence.delaySeconds` are deliberately
110
127
  // not filled here. Both are three-state on the wire, and the authoring API
111
128
  // reproduces each state exactly, so filling a default would rewrite a
@@ -113,120 +130,19 @@ function normalizeAgentV2CommitContent(content) {
113
130
  },
114
131
  };
115
132
  }
116
- function replaceActionVersionUuid({ versionUuid, actions, options, }) {
117
- const actionDefinition = actions.find((item) => item.sourceVersionUuid === versionUuid);
118
- if (actionDefinition === undefined) {
119
- return versionUuid;
120
- }
121
- return options.actionVersionUuids?.[actionDefinition.key] ?? versionUuid;
122
- }
123
- function compileSnapshotNode({ node, actions, options, }) {
124
- if (node.type === 'action_node') {
125
- return {
126
- ...node,
127
- actionVersionUuid: replaceActionVersionUuid({
128
- versionUuid: node.actionVersionUuid,
129
- actions,
130
- options,
131
- }),
132
- };
133
- }
134
- if (node.type === 'standard' && node.perTurnAction != null) {
135
- return {
136
- ...node,
137
- perTurnAction: {
138
- ...node.perTurnAction,
139
- actionVersionUuid: replaceActionVersionUuid({
140
- versionUuid: node.perTurnAction.actionVersionUuid,
141
- actions,
142
- options,
143
- }),
144
- },
145
- };
146
- }
147
- return node;
148
- }
149
- function compileSnapshot(definition, options) {
150
- const normalizedContent = normalizeAgentV2CommitContent(definition.content);
151
- const snapshotActionValues = (values) => {
152
- switch (values.actionType) {
153
- case 'code':
154
- return {
155
- ...values,
156
- operation: {
157
- ...values.operation,
158
- compiledJs: null,
159
- },
160
- };
161
- case 'http':
162
- case 'custom_data':
163
- case 'knowledge_base':
164
- case 'built_in':
165
- return values;
166
- default: {
167
- values;
168
- throw new Error(`Unsupported Action type in snapshot: ${JSON.stringify(values)}`);
169
- }
170
- }
171
- };
172
- return {
173
- agent: definition.agent,
174
- branch: definition.branch,
175
- actions: definition.actions.map((item) => ({
176
- key: item.key,
177
- versionUuid: replaceActionVersionUuid({
178
- versionUuid: item.sourceVersionUuid,
179
- actions: definition.actions,
180
- options,
181
- }),
182
- values: snapshotActionValues(item.values),
183
- })),
184
- content: {
185
- ...normalizedContent,
186
- config: {
187
- ...normalizedContent.config,
188
- ...(normalizedContent.config.toolUseSites === undefined
189
- ? {}
190
- : {
191
- toolUseSites: normalizedContent.config.toolUseSites.map((useSite) => ({
192
- ...useSite,
193
- actionVersionUuid: replaceActionVersionUuid({
194
- versionUuid: useSite.actionVersionUuid,
195
- actions: definition.actions,
196
- options,
197
- }),
198
- })),
199
- }),
200
- automaticActions: {
201
- beforeCallStart: normalizedContent.config.automaticActions.beforeCallStart === null
202
- ? null
203
- : {
204
- ...normalizedContent.config.automaticActions.beforeCallStart,
205
- actionVersionUuid: replaceActionVersionUuid({
206
- versionUuid: normalizedContent.config.automaticActions.beforeCallStart.actionVersionUuid,
207
- actions: definition.actions,
208
- options,
209
- }),
210
- },
211
- },
212
- },
213
- nodes: normalizedContent.nodes.map((node) => compileSnapshotNode({ node, actions: definition.actions, options })),
214
- },
215
- };
216
- }
217
- function compileAgentProject(definition, options = {}) {
218
- return definition.kind === 'agent-definition'
219
- ? (0, agents_1.compileAgent)(definition, options)
220
- : compileSnapshot(definition, options);
221
- }
222
133
  function collectActionVersionUuids(content) {
223
134
  const versionUuids = new Set();
224
135
  for (const useSite of content.config.toolUseSites ?? []) {
225
136
  versionUuids.add(useSite.actionVersionUuid);
226
137
  }
227
- const beforeCallAction = content.config.automaticActions.beforeCallStart;
228
- if (beforeCallAction !== null) {
229
- versionUuids.add(beforeCallAction.actionVersionUuid);
138
+ const { beforeCallStart, callEnd } = content.config.automaticActions;
139
+ for (const automaticAction of [beforeCallStart, callEnd]) {
140
+ if (automaticAction != null) {
141
+ versionUuids.add(automaticAction.actionVersionUuid);
142
+ }
143
+ }
144
+ for (const useSite of assistActionUseSites(content.config.assist)) {
145
+ versionUuids.add(useSite.actionVersionUuid);
230
146
  }
231
147
  for (const node of content.nodes) {
232
148
  if (node.type === 'action_node') {
@@ -238,3 +154,13 @@ function collectActionVersionUuids(content) {
238
154
  }
239
155
  return [...versionUuids];
240
156
  }
157
+ /** Every Action use site an Agent Assist playbook runs: its procedures' steps first, then its card buttons. */
158
+ function assistActionUseSites(assist) {
159
+ if (assist === undefined) {
160
+ return [];
161
+ }
162
+ return [
163
+ ...assist.procedures.flatMap((procedure) => procedure.steps.flatMap((step) => (step.kind === 'run_action' ? [step.action] : []))),
164
+ ...assist.cards.flatMap((card) => card.buttons.map((button) => button.action)),
165
+ ];
166
+ }