@stackbone/sdk 0.1.0-alpha.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts CHANGED
@@ -6,8 +6,8 @@ export { ChunkOptions, ChunkStrategy, DeleteOptions, DeleteResponse, IngestChunk
6
6
  import OpenAI from 'openai';
7
7
  import { ChatCompletionCreateParamsStreaming, ChatCompletionChunk, ChatCompletionCreateParamsNonStreaming, ChatCompletion, EmbeddingCreateParams, CreateEmbeddingResponse, ChatCompletionMessageParam } from 'openai/resources';
8
8
  import { Stream } from 'openai/streaming';
9
- import { A as AgentName } from './workflow-scheduler-DXCNKDOS.cjs';
10
- export { b as AgentRegistry, S as ScheduledWorkflow, c as WorkflowScheduler, a as WorkflowStartHandle, d as WorkflowStarter, W as WorkflowTriggerOptions, g as getWorkflowScheduler, e as getWorkflowStarter, s as setWorkflowScheduler, f as setWorkflowStarter } from './workflow-scheduler-DXCNKDOS.cjs';
9
+ import { W as WorkflowName, c as StartWorkflowOptions, e as WorkflowStartHandle, b as StartWorkflowAndWaitOptions, S as ScheduledWorkflow, A as AgentName } from './agent-registry-BNXuj88Q.cjs';
10
+ export { a as AgentRegistry, g as WorkflowScheduler, h as WorkflowStarter, i as WorkflowTriggerOptions, j as getWorkflowScheduler, k as getWorkflowStarter, l as setWorkflowScheduler, m as setWorkflowStarter } from './agent-registry-BNXuj88Q.cjs';
11
11
  import { a as ConnectionAccessor } from './call-connector-CYDw_yG5.cjs';
12
12
  import { S3Client } from '@aws-sdk/client-s3';
13
13
  import { z } from 'zod';
@@ -1198,6 +1198,37 @@ declare class SecretsFacade {
1198
1198
  private sql;
1199
1199
  }
1200
1200
 
1201
+ /**
1202
+ * The shape of `stackbone.workflows` — the namespaced workflow trigger + schedule
1203
+ * surface. Every `name` is typed `WorkflowName` (a loose `string` until
1204
+ * `stackbone dev` generates `.stackbone/workflows.d.ts`, then the closed set of
1205
+ * declared workflow names — a typo is a compile error).
1206
+ */
1207
+ interface WorkflowsAccessor {
1208
+ /**
1209
+ * Start another workflow BY NAME as its own independent run, fire-and-forget;
1210
+ * resolves to `{ runId }` immediately. Durable `"use step"`. MUST be called from
1211
+ * inside a running workflow. See {@link startWorkflow}.
1212
+ */
1213
+ start(name: WorkflowName, input: unknown, opts?: StartWorkflowOptions): Promise<WorkflowStartHandle>;
1214
+ /**
1215
+ * Run another workflow BY NAME as a durable sub-routine: suspend until it
1216
+ * reaches a terminal state, then return its output validated against the
1217
+ * target's declared output schema. See {@link startWorkflowAndWait}.
1218
+ */
1219
+ startAndWait<TOutput = unknown>(name: WorkflowName, input: unknown, opts?: StartWorkflowAndWaitOptions): Promise<TOutput>;
1220
+ /**
1221
+ * Register (or upsert) a DYNAMIC recurring trigger that starts `name` on the
1222
+ * `cron` cadence. Idempotent by `name`. Prefer the declarative `export const
1223
+ * schedules` for cadences that ship with the workspace. See {@link scheduleWorkflow}.
1224
+ */
1225
+ schedule(name: WorkflowName, input: unknown, cron: string): Promise<void>;
1226
+ /** Cancel a dynamic scheduled trigger by `name`. See {@link unschedule}. */
1227
+ unschedule(name: WorkflowName): Promise<void>;
1228
+ /** List active triggers (declarative + dynamic). See {@link listSchedules}. */
1229
+ listSchedules(): Promise<ScheduledWorkflow[]>;
1230
+ }
1231
+
1201
1232
  /**
1202
1233
  * eve's serialized session cursor. Mirrors eve's nominal `SessionState`
1203
1234
  * interface (`{ continuationToken?, sessionId?, streamIndex }`) so a value the
@@ -1897,6 +1928,22 @@ declare class StackboneClient {
1897
1928
  * signed workflow→agent call and the same eve `Client` API.
1898
1929
  */
1899
1930
  get agent(): AgentAccessor;
1931
+ /**
1932
+ * Namespaced workflow trigger + schedule surface — `stackbone.workflows.start(...)`
1933
+ * / `.startAndWait(...)` / `.schedule(...)` / `.unschedule(...)` / `.listSchedules()`.
1934
+ * Start another workflow by name (fire-and-forget or durable sub-routine) and
1935
+ * manage dynamic cron triggers, all from inside a running workflow.
1936
+ *
1937
+ * These are peer-free shims over the ambient `WorkflowStarter` / `WorkflowScheduler`
1938
+ * the runtime injects on first dispatch — they import NO `workflow` / `eve` peer,
1939
+ * so (like `connection` / `agent`) they are wired directly onto the client and
1940
+ * pull nothing new into the main barrel. This is the namespaced form of the loose
1941
+ * `startWorkflow(...)` / `scheduleWorkflow(...)` exports (now `@deprecated`) on the
1942
+ * `@stackbone/sdk/workflow` subpath; both delegate to the same implementation, so
1943
+ * `start` / `startAndWait` keep their `"use step"` durability. The peer-bound
1944
+ * authoring API (`requestApproval` / `defineHook` / `sleep`) stays on that subpath.
1945
+ */
1946
+ get workflows(): WorkflowsAccessor;
1900
1947
  /**
1901
1948
  * Pending surface — runtime not built. Every method returns
1902
1949
  * `not_implemented`. Mem0 is a third-party integration, not a Stackbone
@@ -2277,8 +2324,9 @@ declare function runWithCallerId<T>(id: string, fn: () => T, options?: {
2277
2324
  * `StackboneClient`: every property access (the surface accessors
2278
2325
  * `storage` / `rag` / `queues` / `database` / `secrets` / `config` / `ai` /
2279
2326
  * `approval` / `legacyConnections` / `memory` / `prompts` / `contract`, the
2280
- * peer-free connector entrypoint `connection(id)`, plus the sibling-agent
2281
- * entrypoint `agent(id)`) is forwarded to the singleton, which is created on the
2327
+ * peer-free connector entrypoint `connection(id)`, the sibling-agent entrypoint
2328
+ * `agent(id)`, plus the peer-free `workflows` trigger/schedule surface) is
2329
+ * forwarded to the singleton, which is created on the
2282
2330
  * first such access. Because each `StackboneClient` accessor is itself lazy +
2283
2331
  * cached, repeated access returns the same surface instance (one client, one
2284
2332
  * pool, per process). `connection` and `agent` are plain function members (no
@@ -2502,4 +2550,4 @@ interface JsonSchemaDocument {
2502
2550
  */
2503
2551
  declare const analyzeAgentSchemas: (pair: AgentSchemaPair) => SchemaIntrospectionResult;
2504
2552
 
2505
- export { type AddMemoryRequest, type AgentAccessor, type AgentSchemaPair, type AgentSpec, type AnyCapability, type ApprovalListOptions, type ApprovalListResult, type ApprovalRecord, type ApprovalRequest, type ApprovalRequestOptions, type ApprovalStatus, type ApprovalTool, type ApprovalToolSpec, type ApprovalTopic, type ApproverInfo, type ClientConfig, type CompilePromptResult, type ConfigRegistry, type ConsoleLike, type CreatePromptRequest, type Decision, type DecisionStatus, type DeleteAllMemoryRequest, type DeletePromptOptions, type DeletePromptResult, type EndSessionOptions, type EndSessionResult, type EveMessageResponse, type EveMessageResult, type EveSessionState, type EveStreamEvent, type FatalConstruct, type GeneratedImage, type GetPromptOptions, INVOCATION_ID_HEADER, INVOKE_TIMEOUT_HARD_CAP_MS, type ImageGenerateParams, type ImagesResponse, type IngestAsyncHandle, type InstallConsoleCaptureOptions, type InvocationContext, type InvokeCapability, type InvokeContext, type InvokeEnvelopeError, type InvokeErrorEnvelope, type InvokeOptions, type InvokeRequest, type InvokeResponse, type InvokeStream, type InvokeSuccessEnvelope, type JobCapability, type JsonSchemaDocument, type LazyAgentClient, type LazyAgentSession, type ListMemoryRequest, type ListMemoryResult, type ListOptions, type ListPromptsOptions, type ListPromptsResult, type LoadSystemSecretsArgs, type LogSink, type Logger, type LoggerBindings, type MemoryContent, type MemoryHistoryEntry, type MemoryHistoryEvent, type MemoryHit, type MemoryItem, type MemoryScope, type ModelsListResponse, type OpenRouterModel, type Prompt, type PublishRequest, RESERVED_ERROR_CODES, RESERVED_HANDLER_NAMES, RUN_ID_HEADER, type ReservedErrorCode, type Result, STORED_TO_SDK_ENV, type ScheduleRequest, type SchemaDiagnostic, type SchemaHalf, type SchemaIntrospectionResult, type SdkError, type SdkErrorCode, type SearchMemoryOptions, type SendTurnInput, type SignedUrl, type SignedUrlOptions, StackboneClient, type StackboneWorkspace, type StorageBody, type StorageObject, type StructuredLoggerOptions, type SystemSecretRow, type SystemSecretsReader, type UnscheduleRequest, type UpdateMemoryOptions, type UpdatePromptOptions, type UploadOptions, type VerifyOptions, type WarnConstruct, type WorkspaceAgent, type WorkspaceStandardSchema, type WorkspaceWorkflow, analyzeAgentSchemas, createClient, createStructuredLogger, defineAgent, defineWorkspace, getInvocationContext, installInvocationConsoleCapture, invokeRequestSchema, isReservedErrorCode, isSdkErrorCode, loadSystemSecretsIntoEnv, rehydrateSystemSecretsRows, runWithCallerId, runWithInvocationContext, stackbone };
2553
+ export { type AddMemoryRequest, type AgentAccessor, type AgentSchemaPair, type AgentSpec, type AnyCapability, type ApprovalListOptions, type ApprovalListResult, type ApprovalRecord, type ApprovalRequest, type ApprovalRequestOptions, type ApprovalStatus, type ApprovalTool, type ApprovalToolSpec, type ApprovalTopic, type ApproverInfo, type ClientConfig, type CompilePromptResult, type ConfigRegistry, type ConsoleLike, type CreatePromptRequest, type Decision, type DecisionStatus, type DeleteAllMemoryRequest, type DeletePromptOptions, type DeletePromptResult, type EndSessionOptions, type EndSessionResult, type EveMessageResponse, type EveMessageResult, type EveSessionState, type EveStreamEvent, type FatalConstruct, type GeneratedImage, type GetPromptOptions, INVOCATION_ID_HEADER, INVOKE_TIMEOUT_HARD_CAP_MS, type ImageGenerateParams, type ImagesResponse, type IngestAsyncHandle, type InstallConsoleCaptureOptions, type InvocationContext, type InvokeCapability, type InvokeContext, type InvokeEnvelopeError, type InvokeErrorEnvelope, type InvokeOptions, type InvokeRequest, type InvokeResponse, type InvokeStream, type InvokeSuccessEnvelope, type JobCapability, type JsonSchemaDocument, type LazyAgentClient, type LazyAgentSession, type ListMemoryRequest, type ListMemoryResult, type ListOptions, type ListPromptsOptions, type ListPromptsResult, type LoadSystemSecretsArgs, type LogSink, type Logger, type LoggerBindings, type MemoryContent, type MemoryHistoryEntry, type MemoryHistoryEvent, type MemoryHit, type MemoryItem, type MemoryScope, type ModelsListResponse, type OpenRouterModel, type Prompt, type PublishRequest, RESERVED_ERROR_CODES, RESERVED_HANDLER_NAMES, RUN_ID_HEADER, type ReservedErrorCode, type Result, STORED_TO_SDK_ENV, type ScheduleRequest, ScheduledWorkflow, type SchemaDiagnostic, type SchemaHalf, type SchemaIntrospectionResult, type SdkError, type SdkErrorCode, type SearchMemoryOptions, type SendTurnInput, type SignedUrl, type SignedUrlOptions, StackboneClient, type StackboneWorkspace, type StorageBody, type StorageObject, type StructuredLoggerOptions, type SystemSecretRow, type SystemSecretsReader, type UnscheduleRequest, type UpdateMemoryOptions, type UpdatePromptOptions, type UploadOptions, type VerifyOptions, type WarnConstruct, WorkflowStartHandle, type WorkflowsAccessor, type WorkspaceAgent, type WorkspaceStandardSchema, type WorkspaceWorkflow, analyzeAgentSchemas, createClient, createStructuredLogger, defineAgent, defineWorkspace, getInvocationContext, installInvocationConsoleCapture, invokeRequestSchema, isReservedErrorCode, isSdkErrorCode, loadSystemSecretsIntoEnv, rehydrateSystemSecretsRows, runWithCallerId, runWithInvocationContext, stackbone };
package/index.d.ts CHANGED
@@ -6,8 +6,8 @@ export { ChunkOptions, ChunkStrategy, DeleteOptions, DeleteResponse, IngestChunk
6
6
  import OpenAI from 'openai';
7
7
  import { ChatCompletionCreateParamsStreaming, ChatCompletionChunk, ChatCompletionCreateParamsNonStreaming, ChatCompletion, EmbeddingCreateParams, CreateEmbeddingResponse, ChatCompletionMessageParam } from 'openai/resources';
8
8
  import { Stream } from 'openai/streaming';
9
- import { A as AgentName } from './workflow-scheduler-DXCNKDOS.js';
10
- export { b as AgentRegistry, S as ScheduledWorkflow, c as WorkflowScheduler, a as WorkflowStartHandle, d as WorkflowStarter, W as WorkflowTriggerOptions, g as getWorkflowScheduler, e as getWorkflowStarter, s as setWorkflowScheduler, f as setWorkflowStarter } from './workflow-scheduler-DXCNKDOS.js';
9
+ import { W as WorkflowName, c as StartWorkflowOptions, e as WorkflowStartHandle, b as StartWorkflowAndWaitOptions, S as ScheduledWorkflow, A as AgentName } from './agent-registry-BNXuj88Q.js';
10
+ export { a as AgentRegistry, g as WorkflowScheduler, h as WorkflowStarter, i as WorkflowTriggerOptions, j as getWorkflowScheduler, k as getWorkflowStarter, l as setWorkflowScheduler, m as setWorkflowStarter } from './agent-registry-BNXuj88Q.js';
11
11
  import { a as ConnectionAccessor } from './call-connector-CYDw_yG5.js';
12
12
  import { S3Client } from '@aws-sdk/client-s3';
13
13
  import { z } from 'zod';
@@ -1198,6 +1198,37 @@ declare class SecretsFacade {
1198
1198
  private sql;
1199
1199
  }
1200
1200
 
1201
+ /**
1202
+ * The shape of `stackbone.workflows` — the namespaced workflow trigger + schedule
1203
+ * surface. Every `name` is typed `WorkflowName` (a loose `string` until
1204
+ * `stackbone dev` generates `.stackbone/workflows.d.ts`, then the closed set of
1205
+ * declared workflow names — a typo is a compile error).
1206
+ */
1207
+ interface WorkflowsAccessor {
1208
+ /**
1209
+ * Start another workflow BY NAME as its own independent run, fire-and-forget;
1210
+ * resolves to `{ runId }` immediately. Durable `"use step"`. MUST be called from
1211
+ * inside a running workflow. See {@link startWorkflow}.
1212
+ */
1213
+ start(name: WorkflowName, input: unknown, opts?: StartWorkflowOptions): Promise<WorkflowStartHandle>;
1214
+ /**
1215
+ * Run another workflow BY NAME as a durable sub-routine: suspend until it
1216
+ * reaches a terminal state, then return its output validated against the
1217
+ * target's declared output schema. See {@link startWorkflowAndWait}.
1218
+ */
1219
+ startAndWait<TOutput = unknown>(name: WorkflowName, input: unknown, opts?: StartWorkflowAndWaitOptions): Promise<TOutput>;
1220
+ /**
1221
+ * Register (or upsert) a DYNAMIC recurring trigger that starts `name` on the
1222
+ * `cron` cadence. Idempotent by `name`. Prefer the declarative `export const
1223
+ * schedules` for cadences that ship with the workspace. See {@link scheduleWorkflow}.
1224
+ */
1225
+ schedule(name: WorkflowName, input: unknown, cron: string): Promise<void>;
1226
+ /** Cancel a dynamic scheduled trigger by `name`. See {@link unschedule}. */
1227
+ unschedule(name: WorkflowName): Promise<void>;
1228
+ /** List active triggers (declarative + dynamic). See {@link listSchedules}. */
1229
+ listSchedules(): Promise<ScheduledWorkflow[]>;
1230
+ }
1231
+
1201
1232
  /**
1202
1233
  * eve's serialized session cursor. Mirrors eve's nominal `SessionState`
1203
1234
  * interface (`{ continuationToken?, sessionId?, streamIndex }`) so a value the
@@ -1897,6 +1928,22 @@ declare class StackboneClient {
1897
1928
  * signed workflow→agent call and the same eve `Client` API.
1898
1929
  */
1899
1930
  get agent(): AgentAccessor;
1931
+ /**
1932
+ * Namespaced workflow trigger + schedule surface — `stackbone.workflows.start(...)`
1933
+ * / `.startAndWait(...)` / `.schedule(...)` / `.unschedule(...)` / `.listSchedules()`.
1934
+ * Start another workflow by name (fire-and-forget or durable sub-routine) and
1935
+ * manage dynamic cron triggers, all from inside a running workflow.
1936
+ *
1937
+ * These are peer-free shims over the ambient `WorkflowStarter` / `WorkflowScheduler`
1938
+ * the runtime injects on first dispatch — they import NO `workflow` / `eve` peer,
1939
+ * so (like `connection` / `agent`) they are wired directly onto the client and
1940
+ * pull nothing new into the main barrel. This is the namespaced form of the loose
1941
+ * `startWorkflow(...)` / `scheduleWorkflow(...)` exports (now `@deprecated`) on the
1942
+ * `@stackbone/sdk/workflow` subpath; both delegate to the same implementation, so
1943
+ * `start` / `startAndWait` keep their `"use step"` durability. The peer-bound
1944
+ * authoring API (`requestApproval` / `defineHook` / `sleep`) stays on that subpath.
1945
+ */
1946
+ get workflows(): WorkflowsAccessor;
1900
1947
  /**
1901
1948
  * Pending surface — runtime not built. Every method returns
1902
1949
  * `not_implemented`. Mem0 is a third-party integration, not a Stackbone
@@ -2277,8 +2324,9 @@ declare function runWithCallerId<T>(id: string, fn: () => T, options?: {
2277
2324
  * `StackboneClient`: every property access (the surface accessors
2278
2325
  * `storage` / `rag` / `queues` / `database` / `secrets` / `config` / `ai` /
2279
2326
  * `approval` / `legacyConnections` / `memory` / `prompts` / `contract`, the
2280
- * peer-free connector entrypoint `connection(id)`, plus the sibling-agent
2281
- * entrypoint `agent(id)`) is forwarded to the singleton, which is created on the
2327
+ * peer-free connector entrypoint `connection(id)`, the sibling-agent entrypoint
2328
+ * `agent(id)`, plus the peer-free `workflows` trigger/schedule surface) is
2329
+ * forwarded to the singleton, which is created on the
2282
2330
  * first such access. Because each `StackboneClient` accessor is itself lazy +
2283
2331
  * cached, repeated access returns the same surface instance (one client, one
2284
2332
  * pool, per process). `connection` and `agent` are plain function members (no
@@ -2502,4 +2550,4 @@ interface JsonSchemaDocument {
2502
2550
  */
2503
2551
  declare const analyzeAgentSchemas: (pair: AgentSchemaPair) => SchemaIntrospectionResult;
2504
2552
 
2505
- export { type AddMemoryRequest, type AgentAccessor, type AgentSchemaPair, type AgentSpec, type AnyCapability, type ApprovalListOptions, type ApprovalListResult, type ApprovalRecord, type ApprovalRequest, type ApprovalRequestOptions, type ApprovalStatus, type ApprovalTool, type ApprovalToolSpec, type ApprovalTopic, type ApproverInfo, type ClientConfig, type CompilePromptResult, type ConfigRegistry, type ConsoleLike, type CreatePromptRequest, type Decision, type DecisionStatus, type DeleteAllMemoryRequest, type DeletePromptOptions, type DeletePromptResult, type EndSessionOptions, type EndSessionResult, type EveMessageResponse, type EveMessageResult, type EveSessionState, type EveStreamEvent, type FatalConstruct, type GeneratedImage, type GetPromptOptions, INVOCATION_ID_HEADER, INVOKE_TIMEOUT_HARD_CAP_MS, type ImageGenerateParams, type ImagesResponse, type IngestAsyncHandle, type InstallConsoleCaptureOptions, type InvocationContext, type InvokeCapability, type InvokeContext, type InvokeEnvelopeError, type InvokeErrorEnvelope, type InvokeOptions, type InvokeRequest, type InvokeResponse, type InvokeStream, type InvokeSuccessEnvelope, type JobCapability, type JsonSchemaDocument, type LazyAgentClient, type LazyAgentSession, type ListMemoryRequest, type ListMemoryResult, type ListOptions, type ListPromptsOptions, type ListPromptsResult, type LoadSystemSecretsArgs, type LogSink, type Logger, type LoggerBindings, type MemoryContent, type MemoryHistoryEntry, type MemoryHistoryEvent, type MemoryHit, type MemoryItem, type MemoryScope, type ModelsListResponse, type OpenRouterModel, type Prompt, type PublishRequest, RESERVED_ERROR_CODES, RESERVED_HANDLER_NAMES, RUN_ID_HEADER, type ReservedErrorCode, type Result, STORED_TO_SDK_ENV, type ScheduleRequest, type SchemaDiagnostic, type SchemaHalf, type SchemaIntrospectionResult, type SdkError, type SdkErrorCode, type SearchMemoryOptions, type SendTurnInput, type SignedUrl, type SignedUrlOptions, StackboneClient, type StackboneWorkspace, type StorageBody, type StorageObject, type StructuredLoggerOptions, type SystemSecretRow, type SystemSecretsReader, type UnscheduleRequest, type UpdateMemoryOptions, type UpdatePromptOptions, type UploadOptions, type VerifyOptions, type WarnConstruct, type WorkspaceAgent, type WorkspaceStandardSchema, type WorkspaceWorkflow, analyzeAgentSchemas, createClient, createStructuredLogger, defineAgent, defineWorkspace, getInvocationContext, installInvocationConsoleCapture, invokeRequestSchema, isReservedErrorCode, isSdkErrorCode, loadSystemSecretsIntoEnv, rehydrateSystemSecretsRows, runWithCallerId, runWithInvocationContext, stackbone };
2553
+ export { type AddMemoryRequest, type AgentAccessor, type AgentSchemaPair, type AgentSpec, type AnyCapability, type ApprovalListOptions, type ApprovalListResult, type ApprovalRecord, type ApprovalRequest, type ApprovalRequestOptions, type ApprovalStatus, type ApprovalTool, type ApprovalToolSpec, type ApprovalTopic, type ApproverInfo, type ClientConfig, type CompilePromptResult, type ConfigRegistry, type ConsoleLike, type CreatePromptRequest, type Decision, type DecisionStatus, type DeleteAllMemoryRequest, type DeletePromptOptions, type DeletePromptResult, type EndSessionOptions, type EndSessionResult, type EveMessageResponse, type EveMessageResult, type EveSessionState, type EveStreamEvent, type FatalConstruct, type GeneratedImage, type GetPromptOptions, INVOCATION_ID_HEADER, INVOKE_TIMEOUT_HARD_CAP_MS, type ImageGenerateParams, type ImagesResponse, type IngestAsyncHandle, type InstallConsoleCaptureOptions, type InvocationContext, type InvokeCapability, type InvokeContext, type InvokeEnvelopeError, type InvokeErrorEnvelope, type InvokeOptions, type InvokeRequest, type InvokeResponse, type InvokeStream, type InvokeSuccessEnvelope, type JobCapability, type JsonSchemaDocument, type LazyAgentClient, type LazyAgentSession, type ListMemoryRequest, type ListMemoryResult, type ListOptions, type ListPromptsOptions, type ListPromptsResult, type LoadSystemSecretsArgs, type LogSink, type Logger, type LoggerBindings, type MemoryContent, type MemoryHistoryEntry, type MemoryHistoryEvent, type MemoryHit, type MemoryItem, type MemoryScope, type ModelsListResponse, type OpenRouterModel, type Prompt, type PublishRequest, RESERVED_ERROR_CODES, RESERVED_HANDLER_NAMES, RUN_ID_HEADER, type ReservedErrorCode, type Result, STORED_TO_SDK_ENV, type ScheduleRequest, ScheduledWorkflow, type SchemaDiagnostic, type SchemaHalf, type SchemaIntrospectionResult, type SdkError, type SdkErrorCode, type SearchMemoryOptions, type SendTurnInput, type SignedUrl, type SignedUrlOptions, StackboneClient, type StackboneWorkspace, type StorageBody, type StorageObject, type StructuredLoggerOptions, type SystemSecretRow, type SystemSecretsReader, type UnscheduleRequest, type UpdateMemoryOptions, type UpdatePromptOptions, type UploadOptions, type VerifyOptions, type WarnConstruct, WorkflowStartHandle, type WorkflowsAccessor, type WorkspaceAgent, type WorkspaceStandardSchema, type WorkspaceWorkflow, analyzeAgentSchemas, createClient, createStructuredLogger, defineAgent, defineWorkspace, getInvocationContext, installInvocationConsoleCapture, invokeRequestSchema, isReservedErrorCode, isSdkErrorCode, loadSystemSecretsIntoEnv, rehydrateSystemSecretsRows, runWithCallerId, runWithInvocationContext, stackbone };
package/index.js CHANGED
@@ -16010,6 +16010,71 @@ var SecretsFacade = class {
16010
16010
  }
16011
16011
  }
16012
16012
  };
16013
+
16014
+ // src/runtime/workflow-scheduler.ts
16015
+ var current;
16016
+ function setWorkflowScheduler(scheduler) {
16017
+ current = scheduler;
16018
+ }
16019
+ __name(setWorkflowScheduler, "setWorkflowScheduler");
16020
+ function getWorkflowScheduler() {
16021
+ if (!current) {
16022
+ throw new Error("No workflow scheduler is bound. `scheduleWorkflow` / `unschedule` / `listSchedules` can only be called inside a running workflow runtime \u2014 the runtime binds the scheduler on its first dispatch.");
16023
+ }
16024
+ return current;
16025
+ }
16026
+ __name(getWorkflowScheduler, "getWorkflowScheduler");
16027
+
16028
+ // src/surfaces/agent-local/workflows/schedule-workflow.ts
16029
+ async function scheduleWorkflow(name, input, cron) {
16030
+ return getWorkflowScheduler().schedule(name, input, cron);
16031
+ }
16032
+ __name(scheduleWorkflow, "scheduleWorkflow");
16033
+ async function unschedule(name) {
16034
+ return getWorkflowScheduler().unschedule(name);
16035
+ }
16036
+ __name(unschedule, "unschedule");
16037
+ async function listSchedules() {
16038
+ return getWorkflowScheduler().listSchedules();
16039
+ }
16040
+ __name(listSchedules, "listSchedules");
16041
+
16042
+ // src/runtime/workflow-starter.ts
16043
+ var current2;
16044
+ function setWorkflowStarter(starter) {
16045
+ current2 = starter;
16046
+ }
16047
+ __name(setWorkflowStarter, "setWorkflowStarter");
16048
+ function getWorkflowStarter() {
16049
+ if (!current2) {
16050
+ throw new Error("No workflow starter is bound. `startWorkflow` / `startWorkflowAndWait` can only be called from inside a running workflow \u2014 the runtime binds the starter on its first dispatch.");
16051
+ }
16052
+ return current2;
16053
+ }
16054
+ __name(getWorkflowStarter, "getWorkflowStarter");
16055
+
16056
+ // src/surfaces/agent-local/workflows/start-workflow.ts
16057
+ async function startWorkflow(name, input, opts) {
16058
+ "use step";
16059
+ return getWorkflowStarter().start(name, input, opts);
16060
+ }
16061
+ __name(startWorkflow, "startWorkflow");
16062
+
16063
+ // src/surfaces/agent-local/workflows/start-workflow-and-wait.ts
16064
+ async function startWorkflowAndWait(name, input, opts) {
16065
+ "use step";
16066
+ return await getWorkflowStarter().startAndWait(name, input, opts);
16067
+ }
16068
+ __name(startWorkflowAndWait, "startWorkflowAndWait");
16069
+
16070
+ // src/surfaces/agent-local/workflows/workflows-accessor.ts
16071
+ var workflows = {
16072
+ start: startWorkflow,
16073
+ startAndWait: startWorkflowAndWait,
16074
+ schedule: scheduleWorkflow,
16075
+ unschedule,
16076
+ listSchedules
16077
+ };
16013
16078
  function agentRegistry() {
16014
16079
  const raw = process.env["AGENT_URLS"];
16015
16080
  if (!raw) {
@@ -17139,6 +17204,24 @@ var StackboneClient = class {
17139
17204
  return agent;
17140
17205
  }
17141
17206
  /**
17207
+ * Namespaced workflow trigger + schedule surface — `stackbone.workflows.start(...)`
17208
+ * / `.startAndWait(...)` / `.schedule(...)` / `.unschedule(...)` / `.listSchedules()`.
17209
+ * Start another workflow by name (fire-and-forget or durable sub-routine) and
17210
+ * manage dynamic cron triggers, all from inside a running workflow.
17211
+ *
17212
+ * These are peer-free shims over the ambient `WorkflowStarter` / `WorkflowScheduler`
17213
+ * the runtime injects on first dispatch — they import NO `workflow` / `eve` peer,
17214
+ * so (like `connection` / `agent`) they are wired directly onto the client and
17215
+ * pull nothing new into the main barrel. This is the namespaced form of the loose
17216
+ * `startWorkflow(...)` / `scheduleWorkflow(...)` exports (now `@deprecated`) on the
17217
+ * `@stackbone/sdk/workflow` subpath; both delegate to the same implementation, so
17218
+ * `start` / `startAndWait` keep their `"use step"` durability. The peer-bound
17219
+ * authoring API (`requestApproval` / `defineHook` / `sleep`) stays on that subpath.
17220
+ */
17221
+ get workflows() {
17222
+ return workflows;
17223
+ }
17224
+ /**
17142
17225
  * Pending surface — runtime not built. Every method returns
17143
17226
  * `not_implemented`. Mem0 is a third-party integration, not a Stackbone
17144
17227
  * Agent Protocol capability, so this surface is intentionally not gated.
@@ -17542,34 +17625,6 @@ function runWithCallerId(id, fn, options) {
17542
17625
  }
17543
17626
  __name(runWithCallerId, "runWithCallerId");
17544
17627
 
17545
- // src/runtime/workflow-starter.ts
17546
- var current;
17547
- function setWorkflowStarter(starter) {
17548
- current = starter;
17549
- }
17550
- __name(setWorkflowStarter, "setWorkflowStarter");
17551
- function getWorkflowStarter() {
17552
- if (!current) {
17553
- throw new Error("No workflow starter is bound. `startWorkflow` / `startWorkflowAndWait` can only be called from inside a running workflow \u2014 the runtime binds the starter on its first dispatch.");
17554
- }
17555
- return current;
17556
- }
17557
- __name(getWorkflowStarter, "getWorkflowStarter");
17558
-
17559
- // src/runtime/workflow-scheduler.ts
17560
- var current2;
17561
- function setWorkflowScheduler(scheduler) {
17562
- current2 = scheduler;
17563
- }
17564
- __name(setWorkflowScheduler, "setWorkflowScheduler");
17565
- function getWorkflowScheduler() {
17566
- if (!current2) {
17567
- throw new Error("No workflow scheduler is bound. `scheduleWorkflow` / `unschedule` / `listSchedules` can only be called inside a running workflow runtime \u2014 the runtime binds the scheduler on its first dispatch.");
17568
- }
17569
- return current2;
17570
- }
17571
- __name(getWorkflowScheduler, "getWorkflowScheduler");
17572
-
17573
17628
  // src/runtime/ambient-client.ts
17574
17629
  var cached;
17575
17630
  function resolveAmbientClient() {