@keystrokehq/cli 1.0.7 → 1.0.9

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { Cn as string, Ct as PromptResponseSchema, Et as ROUTE_MANIFEST_REL_PATH, Sn as object, Tn as toJSONSchema, _n as _function, bn as discriminatedUnion, gn as _enum, hn as ZodType, un as normalizeCredentialList, vn as array, wn as union, xn as literal, yn as custom } from "./dist-DR0-KRom.mjs";
2
+ import { Cn as discriminatedUnion, Dn as union, En as string, Et as PromptResponseSchema, On as toJSONSchema, Sn as custom, Tn as object, bn as _function, kt as ROUTE_MANIFEST_REL_PATH, pn as normalizeCredentialList, vn as ZodType, wn as literal, xn as array, yn as _enum } from "./dist-CtHP_Lct.mjs";
3
3
  import "./chunk-BZUGFHVS-CPWRFwK8.mjs";
4
4
  import "./chunk-DLL7UR66-BUYgzxnR.mjs";
5
5
  import "./chunk-TN7HHBQW-CSB_R-XD.mjs";
@@ -204,7 +204,7 @@ function isCommentLine(line) {
204
204
  return line.startsWith("//") || line.startsWith("/*") || line.startsWith("*");
205
205
  }
206
206
  //#endregion
207
- //#region ../../packages/sandbox/dist/files-psA6qjtf.mjs
207
+ //#region ../../packages/sandbox/dist/files-BOUCjfCQ.mjs
208
208
  const SandboxModeSchema = _enum(["in-process", "vm"]);
209
209
  const SandboxFileContentSchema = object({
210
210
  path: string(),
@@ -547,23 +547,21 @@ const Digit = ["0", ...Range(49, 57)];
547
547
  ], ...Digit];
548
548
  [...Digit];
549
549
  new RegExp(IntegerKey);
550
- //#endregion
551
- //#region ../../packages/sandbox/dist/create-coding-tools-5--zCsRF.mjs
552
550
  const replaceEditSchema = _Object_({
553
551
  oldText: String$1({ description: "Exact text to replace. Must be unique in the file and must not overlap other edits in this call." }),
554
552
  newText: String$1({ description: "Replacement text" })
555
553
  }, { additionalProperties: false });
556
554
  _Object_({
557
- path: String$1({ description: "Path to the file to edit (under /workspace)" }),
555
+ path: String$1({ description: "Path under /workspace (e.g. session/out.txt or agent/data.json)" }),
558
556
  edits: _Array_(replaceEditSchema, { description: "Replacements applied against the original file (not chained). Each oldText must be unique and non-overlapping." })
559
557
  }, { additionalProperties: false });
560
558
  _Object_({
561
- path: String$1({ description: "Path to the file to read (under /workspace)" }),
559
+ path: String$1({ description: "Path under /workspace (e.g. session/out.txt or agent/data.json)" }),
562
560
  offset: Optional(Number$1({ description: "Line number to start reading from (1-indexed)" })),
563
561
  limit: Optional(Number$1({ description: "Maximum number of lines to read" }))
564
562
  });
565
563
  _Object_({
566
- path: String$1({ description: "Path to the file to write (under /workspace)" }),
564
+ path: String$1({ description: "Path under /workspace (e.g. session/out.txt or agent/data.json)" }),
567
565
  content: String$1({ description: "Content to write to the file" })
568
566
  });
569
567
  //#endregion
@@ -1386,7 +1384,7 @@ function isManifestAction(value) {
1386
1384
  function getManifestActionCredentialRequirements(action) {
1387
1385
  return Array.isArray(action.credentials) ? action.credentials : void 0;
1388
1386
  }
1389
- function countAgentCredentials(agent) {
1387
+ function collectAgentCredentialKeys(agent) {
1390
1388
  const keys = /* @__PURE__ */ new Set();
1391
1389
  for (const tool of agent.tools ?? []) {
1392
1390
  const record = tool;
@@ -1394,7 +1392,26 @@ function countAgentCredentials(agent) {
1394
1392
  if (!requirements?.length) continue;
1395
1393
  for (const requirement of normalizeCredentialList(requirements)) keys.add(requirement.key);
1396
1394
  }
1397
- return keys.size;
1395
+ return [...keys].sort();
1396
+ }
1397
+ function countAgentCredentials(agent) {
1398
+ return collectAgentCredentialKeys(agent).length;
1399
+ }
1400
+ /** Single source of truth for the `kind: "agent"` route-manifest entry shape. */
1401
+ function agentManifestEntry(agent, options) {
1402
+ const credentialKeys = collectAgentCredentialKeys(agent);
1403
+ return {
1404
+ kind: "agent",
1405
+ slug: agent.slug,
1406
+ moduleFile: options.moduleFile,
1407
+ name: agent.name,
1408
+ description: agent.description,
1409
+ model: agent.model,
1410
+ systemPrompt: agent.systemPrompt,
1411
+ toolCount: agent.tools?.length ?? 0,
1412
+ credentialCount: countAgentCredentials(agent),
1413
+ credentialKeys
1414
+ };
1398
1415
  }
1399
1416
  const SKIP_DIRS = new Set([".git", "node_modules"]);
1400
1417
  function toPosix$1(path) {
@@ -1469,7 +1486,8 @@ function serializeRouteManifest(manifest) {
1469
1486
  model: entry.model,
1470
1487
  systemPrompt: entry.systemPrompt,
1471
1488
  toolCount: entry.toolCount,
1472
- credentialCount: entry.credentialCount
1489
+ credentialCount: entry.credentialCount,
1490
+ credentialKeys: entry.credentialKeys
1473
1491
  });
1474
1492
  break;
1475
1493
  case "workflow":
@@ -1795,17 +1813,7 @@ async function buildStoredRouteManifestForProject(projectRoot, options) {
1795
1813
  for (const entry of agentEntries) {
1796
1814
  const agent = await importAgentDefinition(entry.filePath, reload);
1797
1815
  const moduleFile = await sourcePaths.resolve("agents", "agent", dirs.agentsDir, entry.filePath);
1798
- manifest.push({
1799
- kind: "agent",
1800
- slug: agent.slug,
1801
- moduleFile,
1802
- name: agent.name,
1803
- description: agent.description,
1804
- model: agent.model,
1805
- systemPrompt: agent.systemPrompt,
1806
- toolCount: agent.tools?.length ?? 0,
1807
- credentialCount: countAgentCredentials(agent)
1808
- });
1816
+ manifest.push(agentManifestEntry(agent, { moduleFile }));
1809
1817
  }
1810
1818
  const workflows = await discoverWorkflows(dirs.workflowsDir, reload);
1811
1819
  for (const workflow of workflows) {
@@ -1894,6 +1902,6 @@ async function emitStoredRouteManifestForProject(projectRoot) {
1894
1902
  persistStoredRouteManifest(projectRoot, await buildStoredRouteManifestForProject(projectRoot));
1895
1903
  }
1896
1904
  //#endregion
1897
- export { entryIdFromFile as A, webhookManifestAttachmentSchemasFromBindings as C, packAssetDirs as D, workflowRouteFromKey as E, shouldSkipKeystrokeModuleFile as M, walkTypeScriptFiles as N, discoverEntries as O, validateImportedWorkflowDefinition as S, webhookRouteFromEndpoint as T, pollGroupId as _, buildWebhookBindingsByRoute as a, toStoredRouteManifest as b, discoverSkillManifestEntries as c, discoverWorkflows as d, emitStoredRouteManifestForProject as f, persistStoredRouteManifest as g, importWorkflowDefinition as h, buildStoredRouteManifestFromContext as i, readKeystrokeIgnoreDirective as j, discoverModuleFileEntries as k, discoverTriggerAttachments as l, importTriggerAttachment as m, buildPollGroups as n, countAgentCredentials as o, importAgentDefinition as p, buildStoredRouteManifestForProject as r, discoverAgentEntries as s, agentRouteFromKey as t, discoverWorkflowEntries as u, schemaToJson as v, webhookMatchSchemaForBindings as w, validateImportedTriggerAttachment as x, serializeRouteManifest as y };
1905
+ export { discoverEntries as A, validateImportedTriggerAttachment as C, webhookRouteFromEndpoint as D, webhookMatchSchemaForBindings as E, walkTypeScriptFiles as F, entryIdFromFile as M, readKeystrokeIgnoreDirective as N, workflowRouteFromKey as O, shouldSkipKeystrokeModuleFile as P, toStoredRouteManifest as S, webhookManifestAttachmentSchemasFromBindings as T, importWorkflowDefinition as _, buildStoredRouteManifestFromContext as a, schemaToJson as b, countAgentCredentials as c, discoverTriggerAttachments as d, discoverWorkflowEntries as f, importTriggerAttachment as g, importAgentDefinition as h, buildStoredRouteManifestForProject as i, discoverModuleFileEntries as j, packAssetDirs as k, discoverAgentEntries as l, emitStoredRouteManifestForProject as m, agentRouteFromKey as n, buildWebhookBindingsByRoute as o, discoverWorkflows as p, buildPollGroups as r, collectAgentCredentialKeys as s, agentManifestEntry as t, discoverSkillManifestEntries as u, persistStoredRouteManifest as v, validateImportedWorkflowDefinition as w, serializeRouteManifest as x, pollGroupId as y };
1898
1906
 
1899
- //# sourceMappingURL=dist-B1SvZCxJ.mjs.map
1907
+ //# sourceMappingURL=dist-BBwM8ovO.mjs.map