@agent-compose/sdk 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -477,6 +477,8 @@ var WORKFLOW_BRAND = Symbol.for("@agent-compose/sdk.Workflow");
477
477
  // src/types/workflow-metadata.ts
478
478
  function extractMetadata(source) {
479
479
  const out = {};
480
+ if (source.description !== undefined)
481
+ out.description = source.description;
480
482
  if (source.networkPolicy !== undefined)
481
483
  out.networkPolicy = freezeMetadataValue(source.networkPolicy);
482
484
  if (source.placeholders !== undefined)
@@ -587,6 +589,7 @@ function defineSandboxEnvironment(env) {
587
589
  throw new Error(`defineSandboxEnvironment(${env.name}): 'setup' must be a function`);
588
590
  }
589
591
  return defineWorkflow({
592
+ ...env.description !== undefined ? { description: env.description } : {},
590
593
  snapshots: env.snapshots ?? { saveLatest: true },
591
594
  memory: env.memory ?? false,
592
595
  run: async (_ctx, sandbox) => env.setup(sandbox)
@@ -477,6 +477,8 @@ var WORKFLOW_BRAND = Symbol.for("@agent-compose/sdk.Workflow");
477
477
  // src/types/workflow-metadata.ts
478
478
  function extractMetadata(source) {
479
479
  const out = {};
480
+ if (source.description !== undefined)
481
+ out.description = source.description;
480
482
  if (source.networkPolicy !== undefined)
481
483
  out.networkPolicy = freezeMetadataValue(source.networkPolicy);
482
484
  if (source.placeholders !== undefined)
@@ -587,6 +589,7 @@ function defineSandboxEnvironment(env) {
587
589
  throw new Error(`defineSandboxEnvironment(${env.name}): 'setup' must be a function`);
588
590
  }
589
591
  return defineWorkflow({
592
+ ...env.description !== undefined ? { description: env.description } : {},
590
593
  snapshots: env.snapshots ?? { saveLatest: true },
591
594
  memory: env.memory ?? false,
592
595
  run: async (_ctx, sandbox) => env.setup(sandbox)
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Regression test: `defineSandboxEnvironment.description` must reach
3
+ * the workflow's metadata so the dashboard template tile shows it
4
+ * instead of "No description.".
5
+ *
6
+ * Earlier the wrapper dropped the field on the floor — `agent-env`
7
+ * literally had `description: "..."` in source but the dashboard
8
+ * rendered "No description." because nothing propagated it through to
9
+ * `WorkflowMetadata.description`.
10
+ */
11
+ export {};
@@ -72,6 +72,11 @@ export interface IOSchema {
72
72
  * output-only release. New code should prefer `IOSchema`. */
73
73
  export type OutputSchema = IOSchema;
74
74
  export interface WorkflowMetadata {
75
+ /** One-line, human-readable description of what the workflow does.
76
+ * Surfaced on the dashboard template tile + run page header. Authors
77
+ * set it via `defineWorkflow({ description: "..." })` (either shape)
78
+ * or `defineSandboxEnvironment({ description: "..." })`. */
79
+ description?: string;
75
80
  networkPolicy?: SandboxNetworkPolicy;
76
81
  placeholders?: Record<string, string>;
77
82
  /** Input schema captured at bundle time from the workflow's
@@ -67,6 +67,9 @@ export type WorkflowFn<TOutput = unknown, TInput extends Record<string, unknown>
67
67
  * works — the workflow just runs with secrets passed directly in env.
68
68
  */
69
69
  export interface WorkflowDefinition<TOutput = unknown, TInput extends Record<string, unknown> = Record<string, unknown>> {
70
+ /** One-line, human-readable description of what this workflow does.
71
+ * Surfaced on the dashboard template tile + run page header. */
72
+ description?: string;
70
73
  run: WorkflowFn<TOutput, TInput>;
71
74
  /**
72
75
  * All snapshot config — boot source plus capture mode.
@@ -38,6 +38,9 @@ export interface WorkflowBuilder<TInput, TCurrent> {
38
38
  }
39
39
  export interface StepWorkflowDefinition<TInput, TOutput> {
40
40
  id: string;
41
+ /** One-line, human-readable description of what this workflow does.
42
+ * Surfaced on the dashboard template tile + run page header. */
43
+ description?: string;
41
44
  input: z.ZodType<TInput>;
42
45
  output: z.ZodType<TOutput>;
43
46
  networkPolicy?: SandboxNetworkPolicy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-compose/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Client library for agent-compose — define agents, runtimes, and workflows, and invoke them against an agent-compose server.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -69,6 +69,7 @@ export function defineSandboxEnvironment(
69
69
  throw new Error(`defineSandboxEnvironment(${env.name}): 'setup' must be a function`);
70
70
  }
71
71
  return defineWorkflow<void, Record<string, unknown>>({
72
+ ...(env.description !== undefined ? { description: env.description } : {}),
72
73
  snapshots: env.snapshots ?? { saveLatest: true },
73
74
  memory: env.memory ?? false,
74
75
  run: async (_ctx, sandbox) => env.setup(sandbox),
@@ -74,6 +74,11 @@ export interface IOSchema {
74
74
  export type OutputSchema = IOSchema;
75
75
 
76
76
  export interface WorkflowMetadata {
77
+ /** One-line, human-readable description of what the workflow does.
78
+ * Surfaced on the dashboard template tile + run page header. Authors
79
+ * set it via `defineWorkflow({ description: "..." })` (either shape)
80
+ * or `defineSandboxEnvironment({ description: "..." })`. */
81
+ description?: string;
77
82
  networkPolicy?: SandboxNetworkPolicy;
78
83
  placeholders?: Record<string, string>;
79
84
  /** Input schema captured at bundle time from the workflow's
@@ -117,6 +122,7 @@ export interface WorkflowMetadata {
117
122
  */
118
123
  export function extractMetadata(source: Partial<WorkflowMetadata>): WorkflowMetadata {
119
124
  const out: WorkflowMetadata = {};
125
+ if (source.description !== undefined) out.description = source.description;
120
126
  if (source.networkPolicy !== undefined) out.networkPolicy = freezeMetadataValue(source.networkPolicy);
121
127
  if (source.placeholders !== undefined) out.placeholders = Object.freeze({ ...source.placeholders });
122
128
  if (source.inputSchema !== undefined) out.inputSchema = freezeMetadataValue(source.inputSchema);
@@ -89,6 +89,9 @@ export interface WorkflowDefinition<
89
89
  TOutput = unknown,
90
90
  TInput extends Record<string, unknown> = Record<string, unknown>,
91
91
  > {
92
+ /** One-line, human-readable description of what this workflow does.
93
+ * Surfaced on the dashboard template tile + run page header. */
94
+ description?: string;
92
95
  run: WorkflowFn<TOutput, TInput>;
93
96
  /**
94
97
  * All snapshot config — boot source plus capture mode.
@@ -43,6 +43,9 @@ export interface WorkflowBuilder<TInput, TCurrent> {
43
43
 
44
44
  export interface StepWorkflowDefinition<TInput, TOutput> {
45
45
  id: string;
46
+ /** One-line, human-readable description of what this workflow does.
47
+ * Surfaced on the dashboard template tile + run page header. */
48
+ description?: string;
46
49
  input: z.ZodType<TInput>;
47
50
  output: z.ZodType<TOutput>;
48
51
  networkPolicy?: SandboxNetworkPolicy;