@getfrontline/cli 1.0.3 → 1.0.5

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 (145) hide show
  1. package/README.md +173 -7
  2. package/dist/commands/agents/builder.d.ts +10 -0
  3. package/dist/commands/agents/builder.d.ts.map +1 -0
  4. package/dist/commands/agents/builder.js +243 -0
  5. package/dist/commands/agents/builder.js.map +1 -0
  6. package/dist/commands/agents/flows.d.ts.map +1 -1
  7. package/dist/commands/agents/flows.js +253 -25
  8. package/dist/commands/agents/flows.js.map +1 -1
  9. package/dist/commands/agents/intents.d.ts +3 -0
  10. package/dist/commands/agents/intents.d.ts.map +1 -0
  11. package/dist/commands/agents/intents.js +137 -0
  12. package/dist/commands/agents/intents.js.map +1 -0
  13. package/dist/commands/agents/use.d.ts +3 -0
  14. package/dist/commands/agents/use.d.ts.map +1 -0
  15. package/dist/commands/agents/use.js +33 -0
  16. package/dist/commands/agents/use.js.map +1 -0
  17. package/dist/commands/agents/variables.d.ts +3 -0
  18. package/dist/commands/agents/variables.d.ts.map +1 -0
  19. package/dist/commands/agents/variables.js +111 -0
  20. package/dist/commands/agents/variables.js.map +1 -0
  21. package/dist/commands/aiModels/index.d.ts +3 -0
  22. package/dist/commands/aiModels/index.d.ts.map +1 -0
  23. package/dist/commands/aiModels/index.js +60 -0
  24. package/dist/commands/aiModels/index.js.map +1 -0
  25. package/dist/commands/incomingWebhooks/index.d.ts +3 -0
  26. package/dist/commands/incomingWebhooks/index.d.ts.map +1 -0
  27. package/dist/commands/incomingWebhooks/index.js +28 -0
  28. package/dist/commands/incomingWebhooks/index.js.map +1 -0
  29. package/dist/commands/object/activity.d.ts +3 -0
  30. package/dist/commands/object/activity.d.ts.map +1 -0
  31. package/dist/commands/object/{note.js → activity.js} +24 -19
  32. package/dist/commands/object/activity.js.map +1 -0
  33. package/dist/commands/object/export.js +3 -3
  34. package/dist/commands/object/field.js +5 -5
  35. package/dist/commands/object/index.js +10 -10
  36. package/dist/commands/object/index.js.map +1 -1
  37. package/dist/commands/object/option.js +4 -4
  38. package/dist/commands/object/record-type.js +4 -4
  39. package/dist/commands/object/record.js +8 -8
  40. package/dist/commands/object/relation.js +4 -4
  41. package/dist/commands/object/view.js +9 -9
  42. package/dist/commands/table/index.d.ts.map +1 -1
  43. package/dist/commands/table/index.js +0 -4
  44. package/dist/commands/table/index.js.map +1 -1
  45. package/dist/commands/tools/index.d.ts +3 -0
  46. package/dist/commands/tools/index.d.ts.map +1 -0
  47. package/dist/commands/tools/index.js +113 -0
  48. package/dist/commands/tools/index.js.map +1 -0
  49. package/dist/commands/util/uuid.d.ts +3 -0
  50. package/dist/commands/util/uuid.d.ts.map +1 -0
  51. package/dist/commands/util/uuid.js +15 -0
  52. package/dist/commands/util/uuid.js.map +1 -0
  53. package/dist/commands/workflows/analytics.d.ts.map +1 -1
  54. package/dist/commands/workflows/analytics.js +9 -3
  55. package/dist/commands/workflows/analytics.js.map +1 -1
  56. package/dist/commands/workflows/common.d.ts +39 -0
  57. package/dist/commands/workflows/common.d.ts.map +1 -0
  58. package/dist/commands/workflows/common.js +45 -0
  59. package/dist/commands/workflows/common.js.map +1 -0
  60. package/dist/commands/workflows/create.d.ts +3 -0
  61. package/dist/commands/workflows/create.d.ts.map +1 -0
  62. package/dist/commands/workflows/create.js +41 -0
  63. package/dist/commands/workflows/create.js.map +1 -0
  64. package/dist/commands/workflows/delete.d.ts +3 -0
  65. package/dist/commands/workflows/delete.d.ts.map +1 -0
  66. package/dist/commands/workflows/delete.js +20 -0
  67. package/dist/commands/workflows/delete.js.map +1 -0
  68. package/dist/commands/workflows/describe.d.ts +3 -0
  69. package/dist/commands/workflows/describe.d.ts.map +1 -0
  70. package/dist/commands/workflows/describe.js +40 -0
  71. package/dist/commands/workflows/describe.js.map +1 -0
  72. package/dist/commands/workflows/edges.d.ts +3 -0
  73. package/dist/commands/workflows/edges.d.ts.map +1 -0
  74. package/dist/commands/workflows/edges.js +50 -0
  75. package/dist/commands/workflows/edges.js.map +1 -0
  76. package/dist/commands/workflows/graph.d.ts +3 -0
  77. package/dist/commands/workflows/graph.d.ts.map +1 -0
  78. package/dist/commands/workflows/graph.js +47 -0
  79. package/dist/commands/workflows/graph.js.map +1 -0
  80. package/dist/commands/workflows/nodes.d.ts +3 -0
  81. package/dist/commands/workflows/nodes.d.ts.map +1 -0
  82. package/dist/commands/workflows/nodes.js +68 -0
  83. package/dist/commands/workflows/nodes.js.map +1 -0
  84. package/dist/commands/workflows/update.d.ts +3 -0
  85. package/dist/commands/workflows/update.d.ts.map +1 -0
  86. package/dist/commands/workflows/update.js +42 -0
  87. package/dist/commands/workflows/update.js.map +1 -0
  88. package/dist/commands/workflows/use.d.ts +3 -0
  89. package/dist/commands/workflows/use.d.ts.map +1 -0
  90. package/dist/commands/workflows/use.js +34 -0
  91. package/dist/commands/workflows/use.js.map +1 -0
  92. package/dist/commands/workflows/variables.d.ts +3 -0
  93. package/dist/commands/workflows/variables.d.ts.map +1 -0
  94. package/dist/commands/workflows/variables.js +105 -0
  95. package/dist/commands/workflows/variables.js.map +1 -0
  96. package/dist/index.js +50 -1
  97. package/dist/index.js.map +1 -1
  98. package/dist/lib/config.d.ts +9 -0
  99. package/dist/lib/config.d.ts.map +1 -1
  100. package/dist/lib/config.js +54 -0
  101. package/dist/lib/config.js.map +1 -1
  102. package/dist/lib/httpClient.d.ts +2 -1
  103. package/dist/lib/httpClient.d.ts.map +1 -1
  104. package/dist/lib/httpClient.js +5 -2
  105. package/dist/lib/httpClient.js.map +1 -1
  106. package/dist/max/ui/banner.js +15 -15
  107. package/dist/max.js +7 -1
  108. package/dist/max.js.map +1 -1
  109. package/dist/scripts/postinstall.d.ts.map +1 -1
  110. package/dist/scripts/postinstall.js +8 -0
  111. package/dist/scripts/postinstall.js.map +1 -1
  112. package/dist/skills/agent-builder/SKILL.md +88 -0
  113. package/dist/skills/aggregations/SKILL.md +7 -7
  114. package/dist/skills/ai-models/SKILL.md +43 -0
  115. package/dist/skills/auth-and-profiles/SKILL.md +1 -1
  116. package/dist/skills/crm-setup/SKILL.md +66 -48
  117. package/dist/skills/crud-operations/SKILL.md +2 -2
  118. package/dist/skills/export-and-delete/SKILL.md +5 -5
  119. package/dist/skills/files/SKILL.md +4 -4
  120. package/dist/skills/filter-and-query/SKILL.md +7 -7
  121. package/dist/skills/flow-builder/SKILL.md +124 -0
  122. package/dist/skills/frontline-agents/SKILL.md +152 -3
  123. package/dist/skills/frontline-internals/SKILL.md +7 -7
  124. package/dist/skills/frontline-workflows/SKILL.md +170 -3
  125. package/dist/skills/incoming-webhooks/SKILL.md +36 -0
  126. package/dist/skills/notes-and-tasks/SKILL.md +29 -29
  127. package/dist/skills/pipeline-setup/SKILL.md +13 -13
  128. package/dist/skills/relations/SKILL.md +15 -15
  129. package/dist/skills/resource-creation/SKILL.md +70 -1
  130. package/dist/skills/schema-design/SKILL.md +21 -14
  131. package/dist/skills/tools/SKILL.md +65 -0
  132. package/dist/skills/variables/SKILL.md +82 -0
  133. package/dist/skills/workflow-builder/SKILL.md +426 -0
  134. package/package.json +51 -51
  135. package/dist/commands/object/note.d.ts +0 -3
  136. package/dist/commands/object/note.d.ts.map +0 -1
  137. package/dist/commands/object/note.js.map +0 -1
  138. package/dist/commands/table/note.d.ts +0 -3
  139. package/dist/commands/table/note.d.ts.map +0 -1
  140. package/dist/commands/table/note.js +0 -62
  141. package/dist/commands/table/note.js.map +0 -1
  142. package/dist/commands/table/task.d.ts +0 -3
  143. package/dist/commands/table/task.d.ts.map +0 -1
  144. package/dist/commands/table/task.js +0 -88
  145. package/dist/commands/table/task.js.map +0 -1
@@ -2,36 +2,62 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.agentsFlowsCommand = void 0;
4
4
  const commander_1 = require("commander");
5
- const httpClient_1 = require("../../lib/httpClient");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
6
  const output_1 = require("../../lib/output");
7
- const helpEpilog_1 = require("../../lib/helpEpilog");
8
- exports.agentsFlowsCommand = new commander_1.Command("flows")
9
- .description("List flows for a specific agent")
10
- .argument("<agentId>", "Agent ID")
11
- .option("--status <status>", "Filter by flow status")
12
- .option("--pretty", "Pretty human-readable output")
13
- .option("--table", "Render as table")
14
- .option("--api-key <key>", helpEpilog_1.FRONTLINE_API_KEY_OPTION)
15
- .option("--base-url <url>", helpEpilog_1.FRONTLINE_BASE_URL_OPTION)
16
- .option("--profile <name>", helpEpilog_1.FRONTLINE_PROFILE_OPTION)
17
- .option("--debug", "Show debug information (redacted token)")
18
- .action(async (agentId, options) => {
19
- let data;
7
+ const config_1 = require("../../lib/config");
8
+ function parseJsonOption(value, optionName) {
9
+ if (!value) {
10
+ (0, output_1.error)("missing_json", `${optionName} is required`, output_1.EXIT_CODES.BAD_INPUT);
11
+ }
20
12
  try {
21
- data = await (0, httpClient_1.apiGet)({
22
- path: `/agents/${agentId}/flows`,
23
- query: { status: options.status },
24
- apiKey: options.apiKey,
25
- baseUrl: options.baseUrl,
26
- profile: options.profile,
27
- debug: options.debug,
28
- });
13
+ return JSON.parse(value);
14
+ }
15
+ catch (err) {
16
+ const message = err instanceof Error ? err.message : String(err);
17
+ (0, output_1.error)("invalid_json", `${optionName} must be valid JSON: ${message}`, output_1.EXIT_CODES.BAD_INPUT);
18
+ }
19
+ }
20
+ function saveActiveAgentId(agentId, opts) {
21
+ try {
22
+ (0, config_1.setActiveAgentId)(agentId, opts.profile);
23
+ }
24
+ catch (err) {
25
+ const message = err instanceof Error ? err.message : String(err);
26
+ (0, output_1.error)("agent_context_error", message, output_1.EXIT_CODES.GENERAL_ERROR);
27
+ }
28
+ }
29
+ function saveActiveFlowId(flowId, opts) {
30
+ try {
31
+ (0, config_1.setActiveFlowId)(flowId, opts.profile);
29
32
  }
30
33
  catch (err) {
31
34
  const message = err instanceof Error ? err.message : String(err);
32
- const hint = err.hint;
33
- (0, output_1.error)("api_error", message, output_1.EXIT_CODES.GENERAL_ERROR, { suggestion: hint });
35
+ (0, output_1.error)("flow_context_error", message, output_1.EXIT_CODES.GENERAL_ERROR);
36
+ }
37
+ }
38
+ function resolveAgentId(opts, positionalAgentId) {
39
+ const agentId = opts.agentId || positionalAgentId || (0, config_1.getActiveAgentId)(opts.profile);
40
+ if (!agentId) {
41
+ (0, output_1.error)("agent_not_selected", "No active agent selected", output_1.EXIT_CODES.BAD_INPUT, {
42
+ suggestion: "Run 'frontline agents use <agent-id>' or pass --agent-id.",
43
+ });
34
44
  }
45
+ return agentId;
46
+ }
47
+ function resolveFlowId(opts) {
48
+ const flowId = opts.flowId ? Number(opts.flowId) : (0, config_1.getActiveFlowId)(opts.profile);
49
+ if (!flowId || !Number.isInteger(flowId) || flowId <= 0) {
50
+ (0, output_1.error)("flow_not_selected", "No active flow selected", output_1.EXIT_CODES.BAD_INPUT, {
51
+ suggestion: "Run 'frontline agents flows use <flow-id>' or pass --flow-id to this command.",
52
+ });
53
+ }
54
+ return flowId;
55
+ }
56
+ async function listFlows(agentId, options) {
57
+ const client = (0, globalOpts_1.requireClient)(options);
58
+ const data = await client.get(`agents/${encodeURIComponent(agentId)}/flows`, {
59
+ status: options.status,
60
+ });
35
61
  if (options.pretty || options.table) {
36
62
  (0, output_1.printTable)(data.results, [
37
63
  "id",
@@ -40,8 +66,210 @@ exports.agentsFlowsCommand = new commander_1.Command("flows")
40
66
  "runCount",
41
67
  "createdAt",
42
68
  ]);
43
- process.exit(0);
69
+ return;
44
70
  }
45
71
  (0, output_1.success)(data);
72
+ }
73
+ exports.agentsFlowsCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("flows"))
74
+ .description("List flows for a specific agent")
75
+ .argument("[agentId]", "Agent ID. Defaults to the active agent")
76
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
77
+ .option("--status <status>", "Filter by flow status")
78
+ .addHelpText("after", `
79
+ Examples:
80
+ $ frontline agents flows <agent-id>
81
+ $ frontline agents use <agent-id>
82
+ $ frontline agents flows list`)
83
+ .action(async (agentIdArg, options) => {
84
+ const agentId = resolveAgentId(options, agentIdArg);
85
+ await listFlows(agentId, options);
86
+ });
87
+ const listCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("list")
88
+ .description("List flows for the active agent or --agent-id")
89
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
90
+ .option("--status <status>", "Filter by flow status")).action(async (options) => {
91
+ const agentId = resolveAgentId(options);
92
+ await listFlows(agentId, options);
93
+ });
94
+ const createCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("create")
95
+ .description("Create a flow for the active agent or --agent-id")
96
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
97
+ .requiredOption("--name <name>", "Flow name")
98
+ .option("--description <description>", "Flow description")
99
+ .option("--no-use", "Do not set the created flow as active")).action(async (options) => {
100
+ const agentId = resolveAgentId(options);
101
+ const client = (0, globalOpts_1.requireClient)(options);
102
+ const flow = await client.post(`agents/${encodeURIComponent(agentId)}/flows`, {
103
+ name: options.name,
104
+ description: options.description,
105
+ });
106
+ saveActiveAgentId(agentId, options);
107
+ if (options.noUse !== true) {
108
+ saveActiveFlowId(flow.id, options);
109
+ }
110
+ (0, output_1.success)({ ...flow, activeAgentId: agentId, activeFlow: options.noUse !== true });
111
+ });
112
+ const useCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("use")
113
+ .description("Select the active flow for the active agent or --agent-id")
114
+ .argument("<flowId>", "Flow ID")
115
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (flowIdArg, options) => {
116
+ const agentId = resolveAgentId(options);
117
+ const flowId = Number(flowIdArg);
118
+ const client = (0, globalOpts_1.requireClient)(options);
119
+ const flow = await client.get(`agents/${encodeURIComponent(agentId)}/flows/${flowId}`);
120
+ saveActiveAgentId(agentId, options);
121
+ saveActiveFlowId(flow.id, options);
122
+ (0, output_1.success)({ activeAgentId: agentId, activeFlowId: flow.id, flow });
123
+ });
124
+ const describeCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("describe")
125
+ .description("Describe the active flow or --flow-id")
126
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
127
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
128
+ .option("--include-nodes", "Include flow nodes")).action(async (options) => {
129
+ const agentId = resolveAgentId(options);
130
+ const flowId = resolveFlowId(options);
131
+ const client = (0, globalOpts_1.requireClient)(options);
132
+ const flow = await client.get(`agents/${encodeURIComponent(agentId)}/flows/${flowId}${options.includeNodes ? "?includeNodes=true" : ""}`);
133
+ (0, output_1.success)(flow);
134
+ });
135
+ const updateCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("update")
136
+ .description("Update the active flow or --flow-id")
137
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
138
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
139
+ .requiredOption("--name <name>", "Flow name")
140
+ .option("--description <description>", "Flow description")
141
+ .option("--status <status>", "Flow status (ACTIVE, DRAFT, SUSPENDED, DELETED)")).action(async (options) => {
142
+ const agentId = resolveAgentId(options);
143
+ const flowId = resolveFlowId(options);
144
+ const client = (0, globalOpts_1.requireClient)(options);
145
+ const flow = await client.put(`agents/${encodeURIComponent(agentId)}/flows/${flowId}`, {
146
+ name: options.name,
147
+ description: options.description,
148
+ status: options.status,
149
+ });
150
+ (0, output_1.success)(flow);
151
+ });
152
+ const deleteCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
153
+ .description("Delete the active flow or --flow-id")
154
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
155
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")).action(async (options) => {
156
+ const agentId = resolveAgentId(options);
157
+ const flowId = resolveFlowId(options);
158
+ const client = (0, globalOpts_1.requireClient)(options);
159
+ await client.delete(`agents/${encodeURIComponent(agentId)}/flows/${flowId}`);
160
+ (0, output_1.success)({ deleted: true, agentId, flowId });
161
+ });
162
+ const graphCmd = (0, globalOpts_1.globalOpts)(new commander_1.Command("graph")
163
+ .description("Get the active flow graph")
164
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
165
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")).action(async (options) => {
166
+ const agentId = resolveAgentId(options);
167
+ const flowId = resolveFlowId(options);
168
+ const client = (0, globalOpts_1.requireClient)(options);
169
+ const graph = await client.get(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/graph`);
170
+ if (options.pretty || options.table) {
171
+ (0, output_1.printTable)(graph.nodes, [
172
+ "nodeId",
173
+ "type",
174
+ "alias",
175
+ "name",
176
+ ]);
177
+ return;
178
+ }
179
+ (0, output_1.success)(graph);
46
180
  });
181
+ const nodesCmd = new commander_1.Command("nodes").description("Manage flow nodes");
182
+ nodesCmd.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("list"))
183
+ .description("List nodes for the active flow")
184
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
185
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
186
+ .action(async (options) => {
187
+ const agentId = resolveAgentId(options);
188
+ const flowId = resolveFlowId(options);
189
+ const client = (0, globalOpts_1.requireClient)(options);
190
+ const graph = await client.get(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/graph`);
191
+ (0, output_1.success)({ results: graph.nodes });
192
+ }));
193
+ nodesCmd.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("create"))
194
+ .description("Create a node in the active flow")
195
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
196
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
197
+ .requiredOption("--data <json>", "Node JSON payload")
198
+ .action(async (options) => {
199
+ const agentId = resolveAgentId(options);
200
+ const flowId = resolveFlowId(options);
201
+ const client = (0, globalOpts_1.requireClient)(options);
202
+ const node = parseJsonOption(options.data, "--data");
203
+ const result = await client.post(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/nodes`, { node });
204
+ (0, output_1.success)(result);
205
+ }));
206
+ nodesCmd.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("update"))
207
+ .description("Update a node in the active flow")
208
+ .argument("<nodeId>", "Node ID")
209
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
210
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
211
+ .requiredOption("--data <json>", "Partial node JSON payload")
212
+ .action(async (nodeId, options) => {
213
+ const agentId = resolveAgentId(options);
214
+ const flowId = resolveFlowId(options);
215
+ const client = (0, globalOpts_1.requireClient)(options);
216
+ const node = parseJsonOption(options.data, "--data");
217
+ const graph = await client.put(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/nodes/${nodeId}`, { node });
218
+ (0, output_1.success)(graph);
219
+ }));
220
+ nodesCmd.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("delete"))
221
+ .description("Delete a node and its connected edges")
222
+ .argument("<nodeId>", "Node ID")
223
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
224
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
225
+ .action(async (nodeId, options) => {
226
+ const agentId = resolveAgentId(options);
227
+ const flowId = resolveFlowId(options);
228
+ const client = (0, globalOpts_1.requireClient)(options);
229
+ const graph = await client.delete(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/nodes/${nodeId}`);
230
+ (0, output_1.success)(graph);
231
+ }));
232
+ const edgesCmd = new commander_1.Command("edges").description("Manage flow edges");
233
+ function edgeFromOptions(options) {
234
+ return {
235
+ source: options.source,
236
+ sourceHandle: options.sourceHandle,
237
+ target: options.target,
238
+ targetHandle: options.targetHandle,
239
+ };
240
+ }
241
+ const addEdgeOptions = (command) => command
242
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
243
+ .option("--flow-id <id>", "Flow ID. Defaults to the active flow")
244
+ .requiredOption("--source <nodeId>", "Source node ID")
245
+ .requiredOption("--source-handle <handleId>", "Source handle ID")
246
+ .requiredOption("--target <nodeId>", "Target node ID")
247
+ .requiredOption("--target-handle <handleId>", "Target handle ID");
248
+ edgesCmd.addCommand((0, globalOpts_1.globalOpts)(addEdgeOptions(new commander_1.Command("add")))
249
+ .description("Add or replace an edge by handle")
250
+ .action(async (options) => {
251
+ const agentId = resolveAgentId(options);
252
+ const flowId = resolveFlowId(options);
253
+ const client = (0, globalOpts_1.requireClient)(options);
254
+ const graph = await client.post(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/edges`, { edge: edgeFromOptions(options) });
255
+ (0, output_1.success)(graph);
256
+ }));
257
+ edgesCmd.addCommand((0, globalOpts_1.globalOpts)(addEdgeOptions(new commander_1.Command("remove")))
258
+ .description("Remove an edge")
259
+ .action(async (options) => {
260
+ const agentId = resolveAgentId(options);
261
+ const flowId = resolveFlowId(options);
262
+ const client = (0, globalOpts_1.requireClient)(options);
263
+ const graph = await client.delete(`agents/${encodeURIComponent(agentId)}/flows/${flowId}/edges`, { edge: edgeFromOptions(options) });
264
+ (0, output_1.success)(graph);
265
+ }));
266
+ exports.agentsFlowsCommand.addCommand(listCmd);
267
+ exports.agentsFlowsCommand.addCommand(createCmd);
268
+ exports.agentsFlowsCommand.addCommand(useCmd);
269
+ exports.agentsFlowsCommand.addCommand(describeCmd);
270
+ exports.agentsFlowsCommand.addCommand(updateCmd);
271
+ exports.agentsFlowsCommand.addCommand(deleteCmd);
272
+ exports.agentsFlowsCommand.addCommand(graphCmd);
273
+ exports.agentsFlowsCommand.addCommand(nodesCmd);
274
+ exports.agentsFlowsCommand.addCommand(edgesCmd);
47
275
  //# sourceMappingURL=flows.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../src/commands/agents/flows.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA8C;AAC9C,6CAA0E;AAC1E,qDAI8B;AA0BjB,QAAA,kBAAkB,GAAG,IAAI,mBAAO,CAAC,OAAO,CAAC;KACjD,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;KACjC,MAAM,CAAC,mBAAmB,EAAE,uBAAu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,eAAe,CAAC,OAAO,CAAC,EAAE,CACrC,CAAC;IACF,IAAA,gBAAO,EAAC,KAAK,CAAC,CAAC;AACnB,CAAC,CAAC,CACT,CAAC;AAEF,0BAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvC,0BAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,0BAAkB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACtC,0BAAkB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC3C,0BAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,0BAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,0BAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACxC,0BAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACxC,0BAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const agentsIntentsCommand: Command;
3
+ //# sourceMappingURL=intents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsEpC,eAAO,MAAM,oBAAoB,SAU5B,CAAC"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agentsIntentsCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const config_1 = require("../../lib/config");
7
+ const output_1 = require("../../lib/output");
8
+ function resolveAgentId(opts) {
9
+ const agentId = opts.agentId || (0, config_1.getActiveAgentId)(opts.profile);
10
+ if (!agentId) {
11
+ (0, output_1.error)("agent_not_selected", "No active agent selected", output_1.EXIT_CODES.BAD_INPUT, {
12
+ suggestion: "Run 'frontline agents use <agent-id>' or pass --agent-id.",
13
+ });
14
+ }
15
+ return agentId;
16
+ }
17
+ function parseJsonOption(value, optionName) {
18
+ if (!value) {
19
+ (0, output_1.error)("missing_json", `${optionName} is required`, output_1.EXIT_CODES.BAD_INPUT);
20
+ }
21
+ try {
22
+ return JSON.parse(value);
23
+ }
24
+ catch (err) {
25
+ const message = err instanceof Error ? err.message : String(err);
26
+ (0, output_1.error)("invalid_json", `${optionName} must be valid JSON: ${message}`, output_1.EXIT_CODES.BAD_INPUT);
27
+ }
28
+ }
29
+ function createIntentPayload(options) {
30
+ return {
31
+ name: options.name,
32
+ description: options.description,
33
+ phrases: parseJsonOption(options.phrases, "--phrases"),
34
+ };
35
+ }
36
+ function updateIntentPayload(options) {
37
+ return {
38
+ name: options.name,
39
+ description: options.description,
40
+ phrases: parseJsonOption(options.phrases, "--phrases"),
41
+ };
42
+ }
43
+ exports.agentsIntentsCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("intents"))
44
+ .description("Manage intents for the active agent")
45
+ .addHelpText("after", `
46
+ Examples:
47
+ $ frontline agents intents list --table
48
+ $ frontline agents intents create --name cancellation --phrases '["cancel order","stop subscription"]'
49
+ $ frontline agents intents update 10 --name cancellation --phrases '[{"id":1,"phrase":"cancel order"},{"phrase":"stop order"}]'
50
+ $ frontline agents intents generate-phrases --name cancellation --samples '["cancel order"]' --amount 5`);
51
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("list")
52
+ .description("List agent intents")
53
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
54
+ .option("--filter-text <text>", "Filter by intent name")
55
+ .option("--include-used-status <true|false>", "Include intents already used by flows")).action(async (options) => {
56
+ const agentId = resolveAgentId(options);
57
+ const client = (0, globalOpts_1.requireClient)(options);
58
+ const data = await client.get(`agents/${encodeURIComponent(agentId)}/intents`, {
59
+ filterText: options.filterText,
60
+ includeUsedStatus: options.includeUsedStatus,
61
+ });
62
+ if (options.pretty || options.table) {
63
+ (0, output_1.printTable)(data.results, [
64
+ "id",
65
+ "name",
66
+ "status",
67
+ ]);
68
+ return;
69
+ }
70
+ (0, output_1.success)(data);
71
+ }));
72
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("all")
73
+ .description("List all agent intents")
74
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
75
+ .option("--include-used-status <true|false>", "Include intents already used by flows")).action(async (options) => {
76
+ const agentId = resolveAgentId(options);
77
+ const client = (0, globalOpts_1.requireClient)(options);
78
+ const data = await client.get(`agents/${encodeURIComponent(agentId)}/intents/all`, { includeUsedStatus: options.includeUsedStatus });
79
+ (0, output_1.success)(data);
80
+ }));
81
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("create")
82
+ .description("Create an agent intent")
83
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
84
+ .requiredOption("--name <name>", "Intent name")
85
+ .option("--description <description>", "Intent description")
86
+ .requiredOption("--phrases <json>", "JSON array of training phrases")).action(async (options) => {
87
+ const agentId = resolveAgentId(options);
88
+ const client = (0, globalOpts_1.requireClient)(options);
89
+ const intent = await client.post(`agents/${encodeURIComponent(agentId)}/intents`, createIntentPayload(options));
90
+ (0, output_1.success)(intent);
91
+ }));
92
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("describe")
93
+ .description("Describe an agent intent")
94
+ .argument("<intentId>", "Intent ID")
95
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (intentId, options) => {
96
+ const agentId = resolveAgentId(options);
97
+ const client = (0, globalOpts_1.requireClient)(options);
98
+ const intent = await client.get(`agents/${encodeURIComponent(agentId)}/intents/${intentId}`);
99
+ (0, output_1.success)(intent);
100
+ }));
101
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("update")
102
+ .description("Update an agent intent")
103
+ .argument("<intentId>", "Intent ID")
104
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
105
+ .requiredOption("--name <name>", "Intent name")
106
+ .option("--description <description>", "Intent description")
107
+ .requiredOption("--phrases <json>", "JSON array of phrase objects")).action(async (intentId, options) => {
108
+ const agentId = resolveAgentId(options);
109
+ const client = (0, globalOpts_1.requireClient)(options);
110
+ const intent = await client.put(`agents/${encodeURIComponent(agentId)}/intents/${intentId}`, updateIntentPayload(options));
111
+ (0, output_1.success)(intent);
112
+ }));
113
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("delete")
114
+ .description("Delete an agent intent")
115
+ .argument("<intentId>", "Intent ID")
116
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")).action(async (intentId, options) => {
117
+ const agentId = resolveAgentId(options);
118
+ const client = (0, globalOpts_1.requireClient)(options);
119
+ await client.delete(`agents/${encodeURIComponent(agentId)}/intents/${intentId}`);
120
+ (0, output_1.success)({ deleted: true, intentId: Number(intentId) });
121
+ }));
122
+ exports.agentsIntentsCommand.addCommand((0, globalOpts_1.globalOpts)(new commander_1.Command("generate-phrases")
123
+ .description("Generate suggested phrases for an intent")
124
+ .option("--agent-id <id>", "Agent ID. Defaults to the active agent")
125
+ .requiredOption("--name <name>", "Intent name")
126
+ .requiredOption("--samples <json>", "JSON array of sample phrases")
127
+ .option("--amount <number>", "Amount of phrases to generate", "10")).action(async (options) => {
128
+ const agentId = resolveAgentId(options);
129
+ const client = (0, globalOpts_1.requireClient)(options);
130
+ const result = await client.post(`agents/${encodeURIComponent(agentId)}/intents/generate-phrases`, {
131
+ name: options.name,
132
+ samples: parseJsonOption(options.samples, "--samples"),
133
+ amount: Number(options.amount),
134
+ });
135
+ (0, output_1.success)(result);
136
+ }));
137
+ //# sourceMappingURL=intents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intents.js","sourceRoot":"","sources":["../../../src/commands/agents/intents.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA0E;AAC1E,6CAAoD;A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M,CAAC,IAAI,CAC5B,UAAU,kBAAkB,CAAC,OAAO,CAAC,2BAA2B,EAChE;QACI,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,eAAe,CAAW,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC;QAChE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;KACjC,CACJ,CAAC;IACF,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC;AACpB,CAAC,CAAC,CACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const agentsUseCommand: Command;
3
+ //# sourceMappingURL=use.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,eAAO,MAAM,gBAAgB,SAsB3B,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agentsUseCommand = void 0;
4
+ const commander_1 = require("commander");
5
+ const globalOpts_1 = require("../../lib/globalOpts");
6
+ const config_1 = require("../../lib/config");
7
+ const output_1 = require("../../lib/output");
8
+ function saveActiveAgentId(agentId, opts) {
9
+ try {
10
+ (0, config_1.setActiveAgentId)(agentId, opts.profile);
11
+ }
12
+ catch (err) {
13
+ const message = err instanceof Error ? err.message : String(err);
14
+ (0, output_1.error)("agent_context_error", message, output_1.EXIT_CODES.GENERAL_ERROR);
15
+ }
16
+ }
17
+ exports.agentsUseCommand = (0, globalOpts_1.globalOpts)(new commander_1.Command("use")
18
+ .description("Select the active agent for flow commands")
19
+ .argument("<agentId>", "Agent ID")
20
+ .addHelpText("after", `
21
+ Examples:
22
+ $ frontline agents use 550e8400-e29b-41d4-a716-446655440000
23
+ $ frontline agents flows list
24
+
25
+ The selected agent is stored in the current CLI profile.`)).action(async (agentId, opts) => {
26
+ saveActiveAgentId(agentId, opts);
27
+ if (opts.pretty || opts.table) {
28
+ (0, output_1.printKeyValue)({ activeAgentId: agentId });
29
+ return;
30
+ }
31
+ (0, output_1.success)({ activeAgentId: agentId });
32
+ });
33
+ //# sourceMappingURL=use.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use.js","sourceRoot":"","sources":["../../../src/commands/agents/use.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,qDAA2D;AAC3D,6CAAoD;AACpD,6CAA6E;AAE7E,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAA0B;IAClE,IAAI,CAAC;QACD,IAAA,yBAAgB,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,IAAA,cAAK,EAAC,qBAAqB,EAAE,OAAO,EAAE,mBAAU,CAAC,aAAa,CAAC,CAAC;IACpE,CAAC;AACL,CAAC;AAEY,QAAA,gBAAgB,GAAG,IAAA,uBAAU,EACtC,IAAI,mBAAO,CAAC,KAAK,CAAC;KACb,WAAW,CAAC,2CAA2C,CAAC;KACxD,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;KACjC,WAAW,CACR,OAAO,EACP;;;;;yDAK6C,CAChD,CACR,CAAC,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,IAAa,EAAE,EAAE;IAC9C,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEjC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAA,sBAAa,EAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;QAC1C,OAAO;IACX,CAAC;IAED,IAAA,gBAAO,EAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare const agentsVariablesCommand: Command;
3
+ //# sourceMappingURL=variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../../src/commands/agents/variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8CpC,eAAO,MAAM,sBAAsB,SAW9B,CAAC"}