@sequenceholdings/studio-cli 0.2.0 → 0.2.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.
@@ -191,6 +191,10 @@ function serializeNodeMetadata(node) {
191
191
  }
192
192
  if (agent.timeout !== undefined)
193
193
  meta.timeout = agent.timeout;
194
+ if (agent.allowedTools !== undefined)
195
+ meta.allowed_tools = [...agent.allowedTools];
196
+ if (agent.outputMode !== undefined)
197
+ meta.output_mode = agent.outputMode;
194
198
  if (agent.workflowId !== undefined)
195
199
  meta.workflow_id = agent.workflowId;
196
200
  if (agent.on_reset_edge_id)
@@ -102,6 +102,8 @@ function emitNode(node, ctx) {
102
102
  ` agent: { id: ${lit(String(m.agent_id))}${m.agent_version !== undefined
103
103
  ? `, version: ${value(m.agent_version)}`
104
104
  : ''} },`,
105
+ m.allowed_tools !== undefined ? ` allowedTools: ${JSON.stringify(m.allowed_tools)},` : null,
106
+ m.output_mode !== undefined ? ` outputMode: ${value(m.output_mode)},` : null,
105
107
  m.workflow_id != null ? ` workflowId: ${lit(String(m.workflow_id))},` : null,
106
108
  m.on_reset_edge_id != null ? ` on_reset_edge_id: ${lit(String(m.on_reset_edge_id))},` : null,
107
109
  m.timeout !== undefined ? ` timeout: ${value(m.timeout)},` : null,
@@ -500,6 +500,9 @@ function serializedAgentContract(node) {
500
500
  const onResetEdgeId = node.metadata.on_reset_edge_id;
501
501
  return {
502
502
  agentId,
503
+ workflowId: node.metadata.workflow_id,
504
+ outputMode: node.metadata.output_mode,
505
+ allowedTools: node.metadata.allowed_tools,
503
506
  ...(typeof agentVersion === 'number' ? { agentVersion } : {}),
504
507
  allEdgeIds: node.outgoing_edges.map((edge) => edge.id),
505
508
  ...(typeof onResetEdgeId === 'string' ? { onResetEdgeId } : {}),
@@ -514,6 +517,9 @@ async function lintAgent(processId, node, errors, warnings, loadAgentSchemaEdgeI
514
517
  nodeId: node.id,
515
518
  agentId: node.agent.id,
516
519
  agentVersion: node.agent.version,
520
+ workflowId: node.workflowId,
521
+ outputMode: node.outputMode,
522
+ allowedTools: node.allowedTools,
517
523
  allEdgeIds: node.outgoing_edges.map((edge) => edge.id),
518
524
  onResetEdgeId: node.on_reset_edge_id,
519
525
  errors,
@@ -523,7 +529,7 @@ async function lintAgent(processId, node, errors, warnings, loadAgentSchemaEdgeI
523
529
  includeStaticValidation: true,
524
530
  });
525
531
  }
526
- async function lintAgentContract({ processId, nodeId, agentId, agentVersion, allEdgeIds, onResetEdgeId, errors, warnings, loadAgentSchemaEdgeIdEnum, suppressUnavailableAgentWarnings, includeStaticValidation, }) {
532
+ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, workflowId, outputMode, allowedTools, allEdgeIds, onResetEdgeId, errors, warnings, loadAgentSchemaEdgeIdEnum, suppressUnavailableAgentWarnings, includeStaticValidation, }) {
527
533
  if (includeStaticValidation && onResetEdgeId && !allEdgeIds.includes(onResetEdgeId)) {
528
534
  errors.push({
529
535
  process_id: processId,
@@ -531,9 +537,38 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
531
537
  message: `on_reset_edge_id "${onResetEdgeId}" is not in outgoing_edges`,
532
538
  });
533
539
  }
540
+ if (workflowId !== undefined && (allowedTools !== undefined || outputMode !== undefined)) {
541
+ errors.push({
542
+ process_id: processId,
543
+ node_id: nodeId,
544
+ message: 'allowedTools and outputMode cannot be used with workflowId',
545
+ });
546
+ }
534
547
  const outgoingIds = allEdgeIds.filter((id) => id !== onResetEdgeId);
548
+ if (allowedTools !== undefined && (!Array.isArray(allowedTools) || allowedTools.length === 0 ||
549
+ allowedTools.some((tool) => typeof tool !== 'string' || tool.trim().length === 0))) {
550
+ errors.push({
551
+ process_id: processId,
552
+ node_id: nodeId,
553
+ message: 'allowedTools must be a nonempty array of nonempty strings',
554
+ });
555
+ }
556
+ if (outputMode !== undefined && outputMode !== 'payload') {
557
+ errors.push({
558
+ process_id: processId,
559
+ node_id: nodeId,
560
+ message: 'unsupported agent outputMode',
561
+ });
562
+ }
563
+ if (outputMode === 'payload' && outgoingIds.length > 1) {
564
+ errors.push({
565
+ process_id: processId,
566
+ node_id: nodeId,
567
+ message: 'payload mode permits at most one normal outgoing edge',
568
+ });
569
+ }
535
570
  if (agentVersion !== undefined) {
536
- if (outgoingIds.length > 1) {
571
+ if (outputMode !== 'payload' && outgoingIds.length > 1) {
537
572
  warnings.push({
538
573
  process_id: processId,
539
574
  node_id: nodeId,
@@ -543,7 +578,7 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
543
578
  return;
544
579
  }
545
580
  if (!loadAgentSchemaEdgeIdEnum) {
546
- if (outgoingIds.length > 1 && !suppressUnavailableAgentWarnings) {
581
+ if (outputMode !== 'payload' && outgoingIds.length > 1 && !suppressUnavailableAgentWarnings) {
547
582
  warnings.push({
548
583
  process_id: processId,
549
584
  node_id: nodeId,
@@ -572,7 +607,7 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
572
607
  });
573
608
  return;
574
609
  }
575
- if (outgoingIds.length === 0)
610
+ if (outputMode === 'payload' || outgoingIds.length === 0)
576
611
  return;
577
612
  if (enumValues === null) {
578
613
  // No edge_id enum is the generic-agent contract: one agent serving nodes
@@ -173,6 +173,8 @@ const BEHAVIORAL_METADATA_FIELDS = {
173
173
  ],
174
174
  agent: [
175
175
  'agent_version',
176
+ 'allowed_tools',
177
+ 'output_mode',
176
178
  'input_mapper_source',
177
179
  'input_mapper_expr',
178
180
  'timeout',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth pat`. Includes Auth0 browser login shared with seqapi.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -43,9 +43,9 @@
43
43
  "zod": "^4.1.13",
44
44
  "@sequenceholdings/agent-spec": "0.1.2",
45
45
  "@sequenceholdings/artifact-studio": "0.3.0",
46
+ "@sequenceholdings/lattice": "0.1.4",
46
47
  "@sequenceholdings/managed-functions": "0.1.1",
47
- "@sequenceholdings/storage": "0.1.0",
48
- "@sequenceholdings/lattice": "0.1.3"
48
+ "@sequenceholdings/storage": "0.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@sequenceholdings/orm": "2.1.0",