deepline 0.3.311 → 0.3.312

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 (113) hide show
  1. package/dist/bundling-sources/sdk/src/play.ts +7 -1
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +100 -25
  4. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -1
  5. package/dist/bundling-sources/shared_libs/plays/core.ts +7 -1
  6. package/dist/bundling-sources/shared_libs/plays/settings-contract.ts +29 -3
  7. package/dist/cli/{auth-2A7OYHFJ.mjs → auth-ACDTPM3M.mjs} +4 -4
  8. package/dist/cli/auth-TFDGA24W.js +31 -0
  9. package/dist/cli/{billing-P7GIAP3U.mjs → billing-FVBBJ77L.mjs} +5 -5
  10. package/dist/cli/{billing-2PQ4VDRR.js → billing-YTJFHEGU.js} +71 -71
  11. package/dist/cli/{chunk-5IBHISKA.js → chunk-6KKETQSI.js} +6 -6
  12. package/dist/cli/{chunk-XDUQQTIS.js → chunk-6LLJWMYH.js} +6 -6
  13. package/dist/cli/{chunk-HOCPOTDX.mjs → chunk-6OGNRAS7.mjs} +2 -2
  14. package/dist/cli/chunk-76VKBPOC.mjs +406 -0
  15. package/dist/cli/{chunk-7TT4LZIR.js → chunk-7SW43OAX.js} +60 -60
  16. package/dist/cli/{chunk-SGTSJCOA.mjs → chunk-AA66YTS7.mjs} +1 -1
  17. package/dist/cli/{chunk-QO3GH6UP.js → chunk-BRJOVSTH.js} +2 -2
  18. package/dist/cli/{chunk-4WFNAWVO.mjs → chunk-EHVJ7XXD.mjs} +2 -2
  19. package/dist/cli/{chunk-G3QP2WYR.mjs → chunk-ENSDO4SG.mjs} +4 -4
  20. package/dist/cli/{chunk-VODJJUKE.js → chunk-FQVTHBEH.js} +15 -15
  21. package/dist/cli/{chunk-DUEHAEPM.mjs → chunk-GTEDCRKC.mjs} +1 -1
  22. package/dist/cli/{play-SOG5Q2GE.mjs → chunk-I25C4KL7.mjs} +166 -90
  23. package/dist/cli/{chunk-W7INSYJS.js → chunk-IALPYID6.js} +3 -3
  24. package/dist/cli/{chunk-ICZB4GTY.mjs → chunk-MK4K5MQU.mjs} +23 -3
  25. package/dist/cli/{chunk-WB6Z2Q44.mjs → chunk-N5V2SBB2.mjs} +19 -1
  26. package/dist/cli/{chunk-TBX7AA7Y.mjs → chunk-NJNYWVEF.mjs} +2 -2
  27. package/dist/cli/{chunk-QJA6SJHA.mjs → chunk-NMZPK7LM.mjs} +1 -1
  28. package/dist/cli/{chunk-5OVNL6LS.mjs → chunk-NWFE4PGX.mjs} +1 -1
  29. package/dist/cli/{chunk-ZDO3TO3M.js → chunk-OJ243ZA5.js} +19 -1
  30. package/dist/cli/{tools-G4HGCHNQ.mjs → chunk-OV6IFAXH.mjs} +180 -36
  31. package/dist/cli/{play-BCMGFYTF.js → chunk-QFSLMI42.js} +342 -266
  32. package/dist/cli/{chunk-LRI2FQF2.js → chunk-T4IJQKRE.js} +26 -26
  33. package/dist/cli/{chunk-RNJ74JDH.js → chunk-TID5XLTZ.js} +4 -4
  34. package/dist/cli/{chunk-QYL5ZV4U.js → chunk-ULI6UVV6.js} +6 -6
  35. package/dist/cli/{chunk-4NIQA6S7.mjs → chunk-US4S3E4Y.mjs} +1 -1
  36. package/dist/cli/{tools-WN7T25LW.js → chunk-V7N6BJQD.js} +231 -87
  37. package/dist/cli/{chunk-IB7OGQGH.js → chunk-VJDKV5RU.js} +29 -9
  38. package/dist/cli/{chunk-Q3LYQTSO.mjs → chunk-WPTUKXIF.mjs} +1 -1
  39. package/dist/cli/chunk-XNL3SEMC.js +406 -0
  40. package/dist/cli/{chunk-GCX3343L.js → chunk-YYU3PYVK.js} +48 -48
  41. package/dist/cli/{chunk-SPUTBCUR.mjs → chunk-ZH7KTVAB.mjs} +1 -1
  42. package/dist/cli/{chunk-FYPZ43Y4.js → chunk-ZQJDRSR5.js} +1 -1
  43. package/dist/cli/{client-PNLDT2M3.mjs → client-ENGOMTTU.mjs} +3 -3
  44. package/dist/cli/client-T6YGH6TT.js +20 -0
  45. package/dist/cli/{csv-L5DN7F45.js → csv-6WOJC6NZ.js} +12 -12
  46. package/dist/cli/{csv-KUAATBZQ.mjs → csv-ENKTPYAJ.mjs} +3 -3
  47. package/dist/cli/{db-6NIH4KTZ.js → db-BAEVP4QK.js} +20 -20
  48. package/dist/cli/{db-WZOD6NP5.mjs → db-DSCJZYJU.mjs} +4 -4
  49. package/dist/cli/describe-PAUHJF7H.mjs +236 -0
  50. package/dist/cli/describe-X2AFAC4B.js +236 -0
  51. package/dist/cli/{executions-TQ5WRHDS.js → executions-LXS6NLCV.js} +6 -6
  52. package/dist/cli/{executions-RDDXGT2Y.mjs → executions-R6JOR67D.mjs} +4 -4
  53. package/dist/cli/{feedback-ZB4WKBSS.mjs → feedback-CYRVNCGT.mjs} +3 -3
  54. package/dist/cli/{feedback-NYKLEQB6.js → feedback-HXP2D7K6.js} +6 -6
  55. package/dist/cli/git-JOE2RM3Q.js +23 -0
  56. package/dist/cli/{git-E6DKAX3X.mjs → git-XBYBZB4R.mjs} +4 -4
  57. package/dist/cli/index.js +82 -78
  58. package/dist/cli/index.mjs +45 -41
  59. package/dist/cli/{legacy-noops-26Y5NSU6.js → legacy-noops-AUNAFEZP.js} +7 -7
  60. package/dist/cli/{legacy-noops-25B7JCOZ.mjs → legacy-noops-OQP6VZKE.mjs} +4 -4
  61. package/dist/cli/{monitors-WRTHO7DT.mjs → monitors-L2HAAPAL.mjs} +7 -7
  62. package/dist/cli/{monitors-L3GFT4MG.js → monitors-QSIZG3CJ.js} +88 -88
  63. package/dist/cli/{org-BNCTGPWF.js → org-JUHQGBQE.js} +60 -60
  64. package/dist/cli/{org-ZTHOFVEO.mjs → org-UCSN5XRC.mjs} +4 -4
  65. package/dist/cli/play-2SNMTZGK.js +152 -0
  66. package/dist/cli/play-5AT2RB3M.mjs +152 -0
  67. package/dist/cli/{providers-MLOKTD6O.js → providers-CVG4L3VR.js} +7 -7
  68. package/dist/cli/{providers-SLAPPVMU.mjs → providers-GVPAPZ4L.mjs} +4 -4
  69. package/dist/cli/{quickstart-IWJLGET3.js → quickstart-7OIFIQG3.js} +5 -5
  70. package/dist/cli/{quickstart-LZRKZLNQ.mjs → quickstart-Y6ZU27LE.mjs} +3 -3
  71. package/dist/cli/{search-RCDGSNWW.mjs → search-4I2Y2NKK.mjs} +13 -5
  72. package/dist/cli/search-DS36UHOX.js +26 -0
  73. package/dist/cli/{secrets-GDPYV6OC.mjs → secrets-3Z4IUEBA.mjs} +4 -4
  74. package/dist/cli/{secrets-24KEMSCU.js → secrets-O2UFLU52.js} +13 -13
  75. package/dist/cli/{sessions-ST5XQQZN.mjs → sessions-OMAXRY5I.mjs} +4 -4
  76. package/dist/cli/{sessions-QOUUGVP3.js → sessions-T6MWWQRH.js} +5 -5
  77. package/dist/cli/{settings-V6Z775TO.mjs → settings-C47WXZY5.mjs} +7 -7
  78. package/dist/cli/{settings-4XWDMAA2.js → settings-R4LO5NMY.js} +74 -74
  79. package/dist/cli/{setup-W7SPZTUL.js → setup-FIUTV4DD.js} +41 -41
  80. package/dist/cli/{setup-QPZLP25U.mjs → setup-JPJVTIQ6.mjs} +6 -6
  81. package/dist/cli/{skills-QG22R2EI.mjs → skills-6WVTMKP5.mjs} +4 -4
  82. package/dist/cli/skills-GLPKPF7R.js +28 -0
  83. package/dist/cli/tools-L3YLQ7BR.js +38 -0
  84. package/dist/cli/tools-TKS77TNU.mjs +38 -0
  85. package/dist/cli/{update-5PSYBGVU.mjs → update-GD754XMA.mjs} +6 -6
  86. package/dist/cli/update-HXI35NME.js +28 -0
  87. package/dist/cli/{workflow-ZEQ46MGG.js → workflow-OCUQCNXA.js} +16 -16
  88. package/dist/cli/{workflow-EK7DV4AQ.mjs → workflow-YKQSPXQZ.mjs} +6 -6
  89. package/dist/{client-DpnkGBn-.d.mts → client-CtVdLZux.d.mts} +21 -4
  90. package/dist/{client-ypdBvf1o.d.ts → client-OBwghxPC.d.ts} +21 -4
  91. package/dist/{compiler-manifest-qtTNYvBl.d.ts → compiler-manifest-wOKNiXpa.d.mts} +21 -0
  92. package/dist/{compiler-manifest-qtTNYvBl.d.mts → compiler-manifest-wOKNiXpa.d.ts} +21 -0
  93. package/dist/index.d.mts +4 -4
  94. package/dist/index.d.ts +4 -4
  95. package/dist/index.js +13 -10
  96. package/dist/index.mjs +16 -13
  97. package/dist/install-integrity.json +84 -76
  98. package/dist/plays/bundle-play-file.d.mts +2 -2
  99. package/dist/plays/bundle-play-file.d.ts +2 -2
  100. package/dist/plays/bundle-play-file.mjs +2 -2
  101. package/dist/plays/run-request.d.mts +2 -2
  102. package/dist/plays/run-request.d.ts +2 -2
  103. package/dist/release.d.mts +1 -1
  104. package/dist/release.d.ts +1 -1
  105. package/dist/release.js +2 -2
  106. package/dist/release.mjs +1 -1
  107. package/package.json +1 -1
  108. package/dist/cli/auth-66JFXP6C.js +0 -31
  109. package/dist/cli/client-ADWRS22F.js +0 -20
  110. package/dist/cli/git-E56KOYJR.js +0 -23
  111. package/dist/cli/search-6FBDSA3K.js +0 -18
  112. package/dist/cli/skills-WKOQBJY7.js +0 -28
  113. package/dist/cli/update-WKVCWGYY.js +0 -28
@@ -89,6 +89,7 @@ var PLAY_SQL_LISTENER_WHERE_OPERATOR_SET = new Set(
89
89
  );
90
90
  var PLAY_AUTHORING_BINDING_FIELDS = {
91
91
  root: [
92
+ "displayName",
92
93
  "billing",
93
94
  "compatibility",
94
95
  "cron",
@@ -185,6 +186,22 @@ var SqlListenerFilterScalarSchema = _typebox.Type.Union([
185
186
  _typebox.Type.Null()
186
187
  ]);
187
188
  var PLAY_AUTHORING_FIELD_REGISTRY = {
189
+ displayName: {
190
+ schema: _typebox.Type.String(),
191
+ fixtures: {
192
+ valid: "Find verified emails",
193
+ invalid: 42,
194
+ absent: void 0,
195
+ unresolved: { expression: "displayName" },
196
+ edition1: "Legacy play"
197
+ },
198
+ referenceType: "string",
199
+ required: false,
200
+ resolution: "static-required",
201
+ issueCode: "play_authoring_binding_invalid",
202
+ description: "Optional human-readable Play name; empty uses the derived identifier.",
203
+ errorMessage: "displayName must be a static string."
204
+ },
188
205
  description: {
189
206
  schema: _typebox.Type.String({ minLength: 1 }),
190
207
  fixtures: {
@@ -1532,6 +1549,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
1532
1549
  "};",
1533
1550
  "export type PlayCronInput<TInput> = TInput extends readonly unknown[] ? never : TInput extends object ? TInput : never;",
1534
1551
  "export type PlayBindings<TInput = Record<string, unknown>> = {",
1552
+ ` displayName?: ${cloudReferenceType("displayName")};`,
1535
1553
  ` description?: ${cloudReferenceType("description")};`,
1536
1554
  ` compatibility?: { toolErrorSchemaVersion?: ${cloudReferenceType("compatibility.toolErrorSchemaVersion")}; toolResponseReceiptRevision?: ${cloudReferenceType("compatibility.toolResponseReceiptRevision")} };`,
1537
1555
  ` inline?: ${cloudReferenceType("inline")};`,
@@ -1610,7 +1628,7 @@ var PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
1610
1628
  " log(message: string, options?: { level?: 'debug' | 'info' | 'warn' | 'error'; context?: Readonly<Record<string, string | number | boolean>> }): void;",
1611
1629
  ` sleep(ms: ${cloudReferenceType("ctx.sleep.ms")}): Promise<void>;`,
1612
1630
  "}",
1613
- "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings<TInput>; billing?: PlayBindings<TInput>['billing']; runtime?: PlayBindings<TInput>['runtime']; compatibility?: PlayBindings<TInput>['compatibility'] };",
1631
+ "export type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = { id: string; displayName?: string; description?: string; input: PlayInputContract<TInput>; run: (ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>; bindings?: PlayBindings<TInput>; billing?: PlayBindings<TInput>['billing']; runtime?: PlayBindings<TInput>['runtime']; compatibility?: PlayBindings<TInput>['compatibility'] };",
1614
1632
  "export type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & { readonly name: string; readonly __inputType?: TInput; readonly __outputType?: TOutput; readonly bindings?: PlayBindings<TInput>; readonly runtime?: PlayBindings<TInput>['runtime']; readonly compatibility?: PlayBindings<TInput>['compatibility'] };",
1615
1633
  "export type PlayHandlerInput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: infer TInput) => Promise<PlayReturnObject> ? TInput : never;",
1616
1634
  "export type PlayHandlerOutput<THandler> = THandler extends (context: DeeplinePlayRuntimeContext, input: unknown) => Promise<infer TOutput extends PlayReturnObject> ? TOutput : never;"
@@ -1,7 +1,13 @@
1
+ import {
2
+ addDescribeOptions,
3
+ rateLimitSummary,
4
+ schemaField,
5
+ schemaFields
6
+ } from "./chunk-76VKBPOC.mjs";
1
7
  import {
2
8
  recentSearchRef,
3
9
  registerDeprecatedSearchCommand
4
- } from "./chunk-ICZB4GTY.mjs";
10
+ } from "./chunk-MK4K5MQU.mjs";
5
11
  import {
6
12
  extractSummaryFields,
7
13
  projectRowOutput,
@@ -12,8 +18,7 @@ import {
12
18
  } from "./chunk-MIMASXO4.mjs";
13
19
  import {
14
20
  DeeplineClient
15
- } from "./chunk-5OVNL6LS.mjs";
16
- import "./chunk-CBVIJSHF.mjs";
21
+ } from "./chunk-NWFE4PGX.mjs";
17
22
  import {
18
23
  beginToolExecuteCommand,
19
24
  getToolExecuteInvocationId,
@@ -28,19 +33,14 @@ import {
28
33
  printJsonError,
29
34
  renderCommandEnvelopeText,
30
35
  shouldEmitJson
31
- } from "./chunk-SPUTBCUR.mjs";
36
+ } from "./chunk-ZH7KTVAB.mjs";
32
37
  import {
33
38
  resolveConfig,
34
39
  sdkCliStateDirPath
35
- } from "./chunk-Q3LYQTSO.mjs";
36
- import "./chunk-DLIRSHV6.mjs";
37
- import "./chunk-SGTSJCOA.mjs";
38
- import "./chunk-6IKARAYD.mjs";
40
+ } from "./chunk-WPTUKXIF.mjs";
39
41
  import {
40
42
  DeeplineError
41
43
  } from "./chunk-NXGCO4JB.mjs";
42
- import "./chunk-WZYKRD7T.mjs";
43
- import "./chunk-KRD6H754.mjs";
44
44
 
45
45
  // src/cli/commands/tools.ts
46
46
  import { Option } from "commander";
@@ -333,7 +333,7 @@ function toolConnectionStatusMessage(input) {
333
333
 
334
334
  // src/cli/commands/tools.ts
335
335
  var TOOL_COMMAND_TEMPLATES = {
336
- describe: "deepline tools describe <toolId>",
336
+ describe: "deepline describe <toolId>",
337
337
  execute: "deepline tools execute <toolId> --input '{...}'"
338
338
  };
339
339
  function toListedTool(tool) {
@@ -594,9 +594,7 @@ async function listToolsInCategory(category, emitJson) {
594
594
  },
595
595
  {
596
596
  title: "next",
597
- lines: [
598
- "Run `deepline tools describe <toolId>` for the full contract."
599
- ]
597
+ lines: ["Run `deepline describe <toolId>` for the full contract."]
600
598
  }
601
599
  ]
602
600
  };
@@ -636,7 +634,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
636
634
  {
637
635
  title: "next",
638
636
  lines: [
639
- "Run `deepline tools describe <toolId>` before executing a tool."
637
+ "Run `deepline describe <toolId>` before executing a tool."
640
638
  ]
641
639
  }
642
640
  ]
@@ -802,7 +800,7 @@ function playAliasToolErrorMessage(toolId, play) {
802
800
  const playName = play.reference ?? play.name;
803
801
  return `${toolId} is a play, not a tool.
804
802
  Use: deepline plays run ${playName} --input '{...}'
805
- Inspect its schema with: deepline plays describe ${playName} --json`;
803
+ Inspect its schema with: deepline describe ${playName}`;
806
804
  }
807
805
  function printPlayAliasToolError(toolId, play) {
808
806
  console.error(playAliasToolErrorMessage(toolId, play));
@@ -847,6 +845,15 @@ function playLikeToolExecuteErrorMessage(toolId, tool) {
847
845
  function printPlayLikeToolExecuteError(toolId, tool) {
848
846
  console.error(playLikeToolExecuteErrorMessage(toolId, tool));
849
847
  }
848
+ var TOOL_ONLY_VIEWS = [
849
+ "compact",
850
+ "contractJson",
851
+ "pricingOnly",
852
+ "examplesOnly",
853
+ "gettersOnly",
854
+ "model",
855
+ "estimatePayload"
856
+ ];
850
857
  function registerToolsCommands(program) {
851
858
  const tools = program.command("tools").description(
852
859
  "Search by intent or structured filters, describe, and execute atomic provider tools."
@@ -859,13 +866,12 @@ Concepts:
859
866
 
860
867
  Common commands:
861
868
  deepline search --type tools email --json
862
- deepline tools describe hunter_email_verifier --json
863
- deepline tools describe hunter_email_verifier --pricing-only --json
869
+ deepline describe hunter_email_verifier
864
870
  deepline tools execute hunter_email_verifier --input '{"email":"a@b.com"}'
865
871
  deepline billing usage --request-id <job_id> --json
866
872
 
867
873
  Output:
868
- Use describe for tool contracts.
874
+ Use deepline describe for tool contracts.
869
875
  Use execute to run a tool.
870
876
  Read pricing before execution; use the returned next.billing command for its
871
877
  exact charge. Workspace balance changes also include other callers' activity.
@@ -955,7 +961,6 @@ Examples:
955
961
  deepline tools describe hunter_email_verifier
956
962
  deepline tools describe hunter_email_verifier --pricing-only
957
963
  deepline tools describe hunter_email_verifier --pricing-only --json
958
- deepline tools describe hunter_email_verifier --schema-only
959
964
  deepline tools describe hunter_email_verifier --examples-only
960
965
  deepline tools describe hunter_email_verifier --json
961
966
  deepline tools describe deeplineagent --model openai/gpt-5.6-luna --json
@@ -969,7 +974,7 @@ Examples:
969
974
  ).option(
970
975
  "--estimate-payload <payload>",
971
976
  "Quote an ai_evaluate, ai_inference, or deeplineagent JSON payload (inline or @file)"
972
- ).option("--pricing-only", "Only print pricing and billing semantics").option("--schema-only", "Only print input schema fields").option(
977
+ ).option("--pricing-only", "Only print pricing and billing semantics").option(
973
978
  "--examples-only",
974
979
  "Only print input payload and full Deepline execution response examples"
975
980
  ).option("--getters-only", "Only print extracted list/value getters").addOption(
@@ -985,7 +990,7 @@ Examples:
985
990
  ).action(async (toolId, options) => {
986
991
  const metadata = compatibilityMetadata;
987
992
  compatibilityMetadata = void 0;
988
- process.exitCode = await getTool(
993
+ const narrowView = () => getTool(
989
994
  toolId,
990
995
  {
991
996
  json: Boolean(options.json),
@@ -1000,9 +1005,26 @@ Examples:
1000
1005
  },
1001
1006
  metadata
1002
1007
  );
1008
+ const narrow = !toolId || TOOL_ONLY_VIEWS.some((view) => options[view] !== void 0);
1009
+ if (narrow) {
1010
+ process.exitCode = await narrowView();
1011
+ return;
1012
+ }
1013
+ const { describeAnything } = await import("./describe-PAUHJF7H.mjs");
1014
+ process.exitCode = await describeAnything(
1015
+ toolId,
1016
+ { ...options, kinds: ["tools", "monitors"], fetchedTool: metadata },
1017
+ // An unknown id keeps this command's own error and play hint.
1018
+ narrowView
1019
+ );
1003
1020
  });
1004
1021
  };
1005
- addToolMetadataCommand(tools.command("describe <toolId>").alias("get"));
1022
+ addToolMetadataCommand(
1023
+ addDescribeOptions(
1024
+ tools.command("describe <toolId>", { hidden: true }).alias("get"),
1025
+ { json: false }
1026
+ )
1027
+ );
1006
1028
  tools.command("execute <toolId>").description("Execute a tool by id.").addHelpText(
1007
1029
  "after",
1008
1030
  `
@@ -1011,14 +1033,14 @@ Notes:
1011
1033
  waterfalls, row maps, checkpoints, and retries.
1012
1034
  Calling a provider-backed tool can spend Deepline credits. Use --json for the
1013
1035
  stable result payload plus output preview and debugging helpers.
1014
- Read pricing first with tools describe <toolId> --pricing-only --json.
1036
+ Read pricing first with deepline describe <toolId>.
1015
1037
  Use the returned next.billing command to look up this execution's exact charge;
1016
1038
  workspace balance changes also include other callers' activity.
1017
1039
  --timeout sets this CLI request's HTTP deadline; it does not cancel provider work.
1018
1040
 
1019
1041
  Examples:
1020
1042
  deepline tools execute hunter_email_verifier --input '{"email":"a@b.com"}'
1021
- deepline tools describe hunter_email_verifier --pricing-only --json
1043
+ deepline describe hunter_email_verifier
1022
1044
  deepline billing usage --request-id <job_id> --json
1023
1045
  deepline tools execute bounceban_verify_bulk --input @batch.json --timeout 10m --json
1024
1046
  deepline tools execute hunter_email_verifier -p email=a@b.com
@@ -1459,7 +1481,127 @@ function printMonitorTypeContract(tool, requestedToolId) {
1459
1481
  console.log("");
1460
1482
  printMonitorTypeDeploy(tool);
1461
1483
  console.log("");
1462
- console.log(`More: deepline tools get ${toolId} --json`);
1484
+ console.log(`More: deepline describe ${toolId}`);
1485
+ }
1486
+ function schemaNodeAt(schema, path) {
1487
+ let node = schema;
1488
+ for (const part of path.split(".").filter(Boolean)) {
1489
+ const [key, ...indexes] = part.split("[");
1490
+ node = recordField(isRecord(node) ? node : {}, "properties")[key];
1491
+ for (const _index of indexes)
1492
+ node = isRecord(node) ? node.items : void 0;
1493
+ }
1494
+ return node;
1495
+ }
1496
+ function jsonSchemaOf(wrapper) {
1497
+ return isRecord(wrapper.jsonSchema) ? wrapper.jsonSchema : wrapper;
1498
+ }
1499
+ function publicToolSchemas(tool) {
1500
+ const scrubbed = (...keys) => {
1501
+ const schema = recordField(tool, ...keys);
1502
+ if (Object.keys(schema).length === 0) return null;
1503
+ const cleaned = publicToolInputSchemaForDescribe(schema);
1504
+ return isRecord(cleaned.jsonSchema) ? cleaned.jsonSchema : cleaned;
1505
+ };
1506
+ const responseSchema = scrubbed("responseSchema", "response_schema");
1507
+ return {
1508
+ inputSchema: scrubbed(
1509
+ "inputSchema",
1510
+ "input_schema",
1511
+ "payload_schema",
1512
+ "payloadSchema"
1513
+ ),
1514
+ outputSchema: scrubbed("outputSchema", "output_schema"),
1515
+ ...responseSchema ? { responseSchema } : {}
1516
+ };
1517
+ }
1518
+ function describedTool(tool, requestedToolId) {
1519
+ const id = stringField2(tool, "toolId") || requestedToolId;
1520
+ const displayName = stringField2(tool, "displayName") || void 0;
1521
+ const description = stringField2(tool, "description") || void 0;
1522
+ if (isMonitorTypeTool(tool)) {
1523
+ return {
1524
+ kind: "monitor_type",
1525
+ id,
1526
+ displayName,
1527
+ description,
1528
+ cost: stringField2(recordField(tool, "pricing"), "displayText") || void 0,
1529
+ guidance: [],
1530
+ inputs: schemaFields(
1531
+ recordField(tool, "payload_schema", "payloadSchema")
1532
+ ),
1533
+ outputs: [],
1534
+ runner: {
1535
+ via: "monitor",
1536
+ deploy: stringField2(recordField(tool, "deploy"), "example") || `deepline monitors deploy '{"key":"...","tool":"${id}","payload":{...}}'`
1537
+ }
1538
+ };
1539
+ }
1540
+ const contract = toolContractJsonForDescribe(tool, requestedToolId);
1541
+ const cost = recordField(contract, "cost");
1542
+ const billing = stringField2(cost, "billingSourceLabel");
1543
+ const deprecation = recordField(contract, "deprecation");
1544
+ const getters = recordField(contract, "getters");
1545
+ const outputSchema = jsonSchemaOf(recordField(contract, "outputSchema"));
1546
+ const toolResult = recordField(tool, "toolResult", "tool_result");
1547
+ const getterDetails = (kind) => new Map(
1548
+ arrayField2(toolResult, kind).filter(isRecord).map((item) => [
1549
+ stringField2(item, "name"),
1550
+ recordField(item, "details")
1551
+ ])
1552
+ );
1553
+ const getterOutputs = (kind, roots) => {
1554
+ const details = getterDetails(kind);
1555
+ return arrayField2(getters, kind).filter(isRecord).map((entry) => {
1556
+ const name = stringField2(entry, "name");
1557
+ const paths = arrayField2(
1558
+ details.get(name) ?? {},
1559
+ "rawToolOutputPaths"
1560
+ ).map((path) => String(path).replace(/^toolResponse\.raw\./, ""));
1561
+ const node = roots.flatMap((root) => paths.map((path) => schemaNodeAt(root, path))).find(isRecord);
1562
+ const { fields, ...typed } = schemaField(name, node, true);
1563
+ const valueType = stringField2(details.get(name) ?? {}, "valueType");
1564
+ const field = {
1565
+ ...typed,
1566
+ // A normalized value has a named type instead of the response's shape.
1567
+ ...valueType ? { type: valueType } : fields ? { fields } : {},
1568
+ // A list's row columns that matter are value getters of their own.
1569
+ ...kind === "extractedLists" && fields ? { summarized: true } : {},
1570
+ read: playResultExpression(entry)
1571
+ };
1572
+ return { field, node };
1573
+ });
1574
+ };
1575
+ const lists = getterOutputs("extractedLists", [outputSchema]);
1576
+ const values = getterOutputs("extractedValues", [
1577
+ outputSchema,
1578
+ ...lists.map(({ node }) => node?.items)
1579
+ ]);
1580
+ const playReference = isPlayLikeTool(tool) ? playReferenceForTool(tool) : null;
1581
+ return {
1582
+ kind: "tool",
1583
+ id: String(contract.toolId),
1584
+ displayName,
1585
+ description,
1586
+ cost: [
1587
+ stringField2(cost, "displayText"),
1588
+ // "Free (free)" says the same thing twice.
1589
+ billing.toLowerCase() === stringField2(cost, "displayText").toLowerCase() ? "" : billing && `(${billing})`
1590
+ ].filter(Boolean).join(" ") || void 0,
1591
+ guidance: [
1592
+ ...contract.deprecated === true ? [`Deprecated. ${stringField2(deprecation, "message")}`.trim()] : [],
1593
+ ...Object.values(recordField(contract, "guidance")).filter(
1594
+ (line) => typeof line === "string" && /[a-z0-9]/i.test(line)
1595
+ )
1596
+ ],
1597
+ rateLimit: rateLimitSummary(
1598
+ recordField(contract, "executionMetadata").configuredRateLimits
1599
+ ),
1600
+ inputs: schemaFields(jsonSchemaOf(recordField(contract, "inputSchema"))),
1601
+ outputs: [...lists, ...values].map(({ field }) => field),
1602
+ rawResponse: schemaFields(outputSchema),
1603
+ runner: playReference ? { via: "play", reference: playReference } : { via: "tool", toolId: String(contract.toolId) }
1604
+ };
1463
1605
  }
1464
1606
  function toolGuidanceLines(guidance) {
1465
1607
  const record = isRecord(guidance) ? guidance : {};
@@ -1516,7 +1658,7 @@ function printCompactToolContract(tool, requestedToolId) {
1516
1658
  }
1517
1659
  console.log("");
1518
1660
  console.log(
1519
- `More: deepline tools describe ${replacementToolId || contract.toolId} --json`
1661
+ `More: deepline describe ${replacementToolId || contract.toolId} --json`
1520
1662
  );
1521
1663
  return;
1522
1664
  }
@@ -1574,9 +1716,7 @@ function printCompactToolContract(tool, requestedToolId) {
1574
1716
  console.log(
1575
1717
  "Provider-specific fields: inspect result.toolResponse.rawV2 and its observed envelope. Prefer the declared getters above."
1576
1718
  );
1577
- console.log(
1578
- `More: deepline tools describe ${contract.toolId} --pricing-only | --schema-only | --examples-only | --getters-only | --json`
1579
- );
1719
+ console.log(`More: deepline describe ${contract.toolId} --json`);
1580
1720
  }
1581
1721
  function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
1582
1722
  if (isMonitorTypeTool(tool)) {
@@ -1718,7 +1858,7 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
1718
1858
  )
1719
1859
  );
1720
1860
  if (playReference) {
1721
- console.log(`deepline plays describe ${playReference} --json`);
1861
+ console.log(`deepline describe ${playReference}`);
1722
1862
  }
1723
1863
  }
1724
1864
  function printToolGettersOnly(tool, requestedToolId) {
@@ -2993,12 +3133,16 @@ async function executeTool(args) {
2993
3133
  }
2994
3134
  return delivered ? executeExitCode : 1;
2995
3135
  }
3136
+
2996
3137
  export {
2997
- buildToolExecuteBaseEnvelope,
2998
- extractToolExecutionWarningMessages,
2999
3138
  isMonitorTypeTool,
3000
- printCompactToolContract,
3001
- printMonitorTypeContract,
3002
3139
  registerToolsCommands,
3003
- toolContractJsonForDescribe
3140
+ toolContractJsonForDescribe,
3141
+ printMonitorTypeContract,
3142
+ publicToolSchemas,
3143
+ describedTool,
3144
+ printCompactToolContract,
3145
+ toolMetadataJsonForDescribe,
3146
+ extractToolExecutionWarningMessages,
3147
+ buildToolExecuteBaseEnvelope
3004
3148
  };