@mindscraft/branch-video-agent-cli 0.3.1 → 0.3.2

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.
@@ -9,6 +9,11 @@ function appendQuery(path, params) {
9
9
  const queryString = query.toString();
10
10
  return queryString ? `${path}?${queryString}` : path;
11
11
  }
12
+ function getRequiredStringAlias(payload, camelKey, snakeKey) {
13
+ const camelValue = payload[camelKey];
14
+ const value = typeof camelValue === 'string' && camelValue.trim() ? camelValue : payload[snakeKey];
15
+ return getRequiredString({ [camelKey]: value }, camelKey);
16
+ }
12
17
  export const agentProductionCommands = {
13
18
  create: async ({ client, payload }) => {
14
19
  const result = await client.request('/api/branch-video/agent-production/create', {
@@ -68,13 +73,14 @@ export const agentProductionCommands = {
68
73
  return { data: result.data, requestId: result.requestId };
69
74
  },
70
75
  'node.submit': async ({ client, payload }) => {
71
- const dagRunId = getRequiredString(payload, 'dagRunId');
72
- const nodeId = getRequiredString(payload, 'nodeId');
76
+ const dagRunId = getRequiredStringAlias(payload, 'dagRunId', 'dag_run_id');
77
+ const nodeId = getRequiredStringAlias(payload, 'nodeId', 'node_id');
78
+ const nodeRunId = getRequiredStringAlias(payload, 'nodeRunId', 'node_run_id');
73
79
  const body = {
74
- ...omitKeys(payload, ['dagRunId', 'nodeId', 'nodeRunId']),
75
- dag_run_id: payload.dag_run_id || dagRunId,
76
- node_id: payload.node_id || nodeId,
77
- node_run_id: payload.node_run_id || payload.nodeRunId,
80
+ ...omitKeys(payload, ['dagRunId', 'dag_run_id', 'nodeId', 'node_id', 'nodeRunId', 'node_run_id']),
81
+ dag_run_id: dagRunId,
82
+ node_id: nodeId,
83
+ node_run_id: nodeRunId,
78
84
  };
79
85
  const result = await client.request(`/api/branch-video/agent-production/dag-runs/${encodeURIComponent(dagRunId)}/nodes/${encodeURIComponent(nodeId)}/submit`, {
80
86
  method: 'POST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindscraft/branch-video-agent-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Published CLI for branch-video and AIHub agent APIs.",
5
5
  "type": "module",
6
6
  "bin": {