@nimble-way/nimble-js 1.1.0 → 1.3.0

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 (101) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/core/streaming.d.mts +33 -0
  3. package/core/streaming.d.mts.map +1 -0
  4. package/core/streaming.d.ts +33 -0
  5. package/core/streaming.d.ts.map +1 -0
  6. package/core/streaming.js +263 -0
  7. package/core/streaming.js.map +1 -0
  8. package/core/streaming.mjs +258 -0
  9. package/core/streaming.mjs.map +1 -0
  10. package/internal/decoders/line.d.mts +17 -0
  11. package/internal/decoders/line.d.mts.map +1 -0
  12. package/internal/decoders/line.d.ts +17 -0
  13. package/internal/decoders/line.d.ts.map +1 -0
  14. package/internal/decoders/line.js +113 -0
  15. package/internal/decoders/line.js.map +1 -0
  16. package/internal/decoders/line.mjs +108 -0
  17. package/internal/decoders/line.mjs.map +1 -0
  18. package/internal/parse.d.mts.map +1 -1
  19. package/internal/parse.d.ts.map +1 -1
  20. package/internal/parse.js +10 -0
  21. package/internal/parse.js.map +1 -1
  22. package/internal/parse.mjs +10 -0
  23. package/internal/parse.mjs.map +1 -1
  24. package/internal/request-options.d.mts +2 -0
  25. package/internal/request-options.d.mts.map +1 -1
  26. package/internal/request-options.d.ts +2 -0
  27. package/internal/request-options.d.ts.map +1 -1
  28. package/internal/request-options.js.map +1 -1
  29. package/internal/request-options.mjs.map +1 -1
  30. package/internal/tslib.js +18 -18
  31. package/package.json +11 -1
  32. package/resources/agents/agents.d.mts +30 -10
  33. package/resources/agents/agents.d.mts.map +1 -1
  34. package/resources/agents/agents.d.ts +30 -10
  35. package/resources/agents/agents.d.ts.map +1 -1
  36. package/resources/agents/agents.js.map +1 -1
  37. package/resources/agents/agents.mjs.map +1 -1
  38. package/resources/agents/index.d.mts +1 -1
  39. package/resources/agents/index.d.mts.map +1 -1
  40. package/resources/agents/index.d.ts +1 -1
  41. package/resources/agents/index.d.ts.map +1 -1
  42. package/resources/agents/index.js.map +1 -1
  43. package/resources/agents/index.mjs.map +1 -1
  44. package/resources/agents/runs.d.mts +31 -8
  45. package/resources/agents/runs.d.mts.map +1 -1
  46. package/resources/agents/runs.d.ts +31 -8
  47. package/resources/agents/runs.d.ts.map +1 -1
  48. package/resources/agents/runs.js +2 -1
  49. package/resources/agents/runs.js.map +1 -1
  50. package/resources/agents/runs.mjs +2 -1
  51. package/resources/agents/runs.mjs.map +1 -1
  52. package/resources/agents/templates.d.mts +2 -2
  53. package/resources/agents/templates.d.mts.map +1 -1
  54. package/resources/agents/templates.d.ts +2 -2
  55. package/resources/agents/templates.d.ts.map +1 -1
  56. package/resources/crawl.d.mts +6 -0
  57. package/resources/crawl.d.mts.map +1 -1
  58. package/resources/crawl.d.ts +6 -0
  59. package/resources/crawl.d.ts.map +1 -1
  60. package/resources/extract/extract.d.mts +24 -0
  61. package/resources/extract/extract.d.mts.map +1 -1
  62. package/resources/extract/extract.d.ts +24 -0
  63. package/resources/extract/extract.d.ts.map +1 -1
  64. package/resources/extract/extract.js.map +1 -1
  65. package/resources/extract/extract.mjs.map +1 -1
  66. package/resources/jobs/jobs.d.mts +60 -0
  67. package/resources/jobs/jobs.d.mts.map +1 -1
  68. package/resources/jobs/jobs.d.ts +60 -0
  69. package/resources/jobs/jobs.d.ts.map +1 -1
  70. package/resources/jobs/jobs.js.map +1 -1
  71. package/resources/jobs/jobs.mjs.map +1 -1
  72. package/resources/top-level.d.mts +7 -0
  73. package/resources/top-level.d.mts.map +1 -1
  74. package/resources/top-level.d.ts +7 -0
  75. package/resources/top-level.d.ts.map +1 -1
  76. package/src/core/streaming.ts +315 -0
  77. package/src/internal/decoders/line.ts +135 -0
  78. package/src/internal/parse.ts +14 -0
  79. package/src/internal/request-options.ts +2 -0
  80. package/src/resources/agents/agents.ts +34 -9
  81. package/src/resources/agents/index.ts +1 -0
  82. package/src/resources/agents/runs.ts +43 -9
  83. package/src/resources/agents/templates.ts +2 -2
  84. package/src/resources/crawl.ts +7 -0
  85. package/src/resources/extract/extract.ts +28 -0
  86. package/src/resources/jobs/jobs.ts +42 -0
  87. package/src/resources/top-level.ts +8 -0
  88. package/src/streaming.ts +2 -0
  89. package/src/version.ts +1 -1
  90. package/streaming.d.mts +3 -0
  91. package/streaming.d.mts.map +1 -0
  92. package/streaming.d.ts +3 -0
  93. package/streaming.d.ts.map +1 -0
  94. package/streaming.js +6 -0
  95. package/streaming.js.map +1 -0
  96. package/streaming.mjs +3 -0
  97. package/streaming.mjs.map +1 -0
  98. package/version.d.mts +1 -1
  99. package/version.d.ts +1 -1
  100. package/version.js +1 -1
  101. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
4
  import { APIPromise } from '../../core/api-promise';
5
+ import { Stream } from '../../core/streaming';
5
6
  import { buildHeaders } from '../../internal/headers';
6
7
  import { RequestOptions } from '../../internal/request-options';
7
8
  import { path } from '../../internal/utils/path';
@@ -60,12 +61,17 @@ export class Runs extends APIResource {
60
61
  * (`text/event-stream`). Create the run with `enable_events: true` to have events
61
62
  * published. A keep-alive comment is sent every 15 seconds.
62
63
  */
63
- streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<void> {
64
+ streamEvents(
65
+ runID: string,
66
+ params: RunStreamEventsParams,
67
+ options?: RequestOptions,
68
+ ): APIPromise<Stream<RunStreamEventsResponse>> {
64
69
  const { agent_id } = params;
65
70
  return this._client.get(path`/v2/agents/${agent_id}/runs/${runID}/events`, {
66
71
  ...options,
67
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
68
- });
72
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
73
+ stream: true,
74
+ }) as APIPromise<Stream<RunStreamEventsResponse>>;
69
75
  }
70
76
  }
71
77
 
@@ -83,7 +89,7 @@ export interface RunCreateResponse {
83
89
  /**
84
90
  * Effort level used for the run.
85
91
  */
86
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
92
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
87
93
 
88
94
  /**
89
95
  * Interaction ID.
@@ -180,7 +186,7 @@ export namespace RunListResponse {
180
186
  /**
181
187
  * Effort level used for the run.
182
188
  */
183
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
189
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
184
190
 
185
191
  /**
186
192
  * Interaction ID.
@@ -255,7 +261,7 @@ export interface RunGetResponse {
255
261
  /**
256
262
  * Effort level used for the run.
257
263
  */
258
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
264
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
259
265
 
260
266
  /**
261
267
  * Interaction ID.
@@ -702,7 +708,7 @@ export namespace RunResultResponse {
702
708
  /**
703
709
  * Effort level used for the run.
704
710
  */
705
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
711
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
706
712
 
707
713
  /**
708
714
  * Interaction ID.
@@ -808,7 +814,7 @@ export namespace RunResultResponse {
808
814
  /**
809
815
  * Effort level used for the run.
810
816
  */
811
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
817
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
812
818
 
813
819
  /**
814
820
  * Interaction ID.
@@ -870,16 +876,24 @@ export namespace RunResultResponse {
870
876
  }
871
877
  }
872
878
 
879
+ export type RunStreamEventsResponse = unknown;
880
+
873
881
  export interface RunCreateParams {
874
882
  /**
875
883
  * User prompt or task instructions for the run.
876
884
  */
877
885
  input: string;
878
886
 
887
+ /**
888
+ * Stable agent name. On this no-agent-id route, an unseen name creates a new
889
+ * agent; an existing name reuses it. Ignored on the /{agent_id}/runs route.
890
+ */
891
+ agent_name?: string | null;
892
+
879
893
  /**
880
894
  * Canonical effort tier names for the research graph.
881
895
  */
882
- effort?: 'low' | 'medium' | 'high' | 'x-high' | 'max' | null;
896
+ effort?: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max' | null;
883
897
 
884
898
  /**
885
899
  * Whether to stream run events when supported.
@@ -892,6 +906,11 @@ export interface RunCreateParams {
892
906
  */
893
907
  input_data?: Array<{ [key: string]: unknown }> | { [key: string]: unknown } | null;
894
908
 
909
+ /**
910
+ * Origin of public API runs. Public requests are always API-originated.
911
+ */
912
+ origin?: 'api';
913
+
895
914
  /**
896
915
  * JSON schema overriding the agent's default structured output for this run.
897
916
  */
@@ -902,10 +921,24 @@ export interface RunCreateParams {
902
921
  */
903
922
  previous_interaction_id?: string | null;
904
923
 
924
+ /**
925
+ * Skill override for this run. One-time only, except when this run creates a new
926
+ * agent via agent_name, in which case it becomes the new agent's stored skill.
927
+ */
928
+ skill?: string | null;
929
+
905
930
  /**
906
931
  * Source guidance overriding the agent default.
907
932
  */
908
933
  sources?: RunCreateParams.Sources | null;
934
+
935
+ /**
936
+ * Only settable when this run creates a new agent (via agent_name, or when no
937
+ * agent is resolved), in which case it becomes the new agent's stored use_case.
938
+ * For a run against an existing agent, this must match the agent's own use_case —
939
+ * passing the same value is accepted as a no-op, a different value is rejected.
940
+ */
941
+ use_case?: 'research' | 'enrichment' | 'dataset_building' | null;
909
942
  }
910
943
 
911
944
  export namespace RunCreateParams {
@@ -995,6 +1028,7 @@ export declare namespace Runs {
995
1028
  type RunListResponse as RunListResponse,
996
1029
  type RunGetResponse as RunGetResponse,
997
1030
  type RunResultResponse as RunResultResponse,
1031
+ type RunStreamEventsResponse as RunStreamEventsResponse,
998
1032
  type RunCreateParams as RunCreateParams,
999
1033
  type RunListParams as RunListParams,
1000
1034
  type RunGetParams as RunGetParams,
@@ -72,7 +72,7 @@ export namespace TemplateListResponse {
72
72
  /**
73
73
  * Default effort level for runs created from this template.
74
74
  */
75
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
75
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
76
76
 
77
77
  /**
78
78
  * Ordered goals for the template.
@@ -203,7 +203,7 @@ export interface TemplateGetResponse {
203
203
  /**
204
204
  * Default effort level for runs created from this template.
205
205
  */
206
- effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
206
+ effort: 'low' | 'medium' | 'high' | 'x-high' | '5x-high' | 'max';
207
207
 
208
208
  /**
209
209
  * Ordered goals for the template.
@@ -1352,6 +1352,13 @@ export namespace CrawlRunParams {
1352
1352
  */
1353
1353
  parser?: { [key: string]: unknown } | string;
1354
1354
 
1355
+ /**
1356
+ * Overall deadline in milliseconds for a realtime request. Clamped to the account
1357
+ * total timeout — it can shorten the deadline but never extend it. Has no effect
1358
+ * on async requests.
1359
+ */
1360
+ realtime_total_timeout?: number;
1361
+
1355
1362
  /**
1356
1363
  * Referrer policy for the request
1357
1364
  */
@@ -1556,6 +1556,13 @@ export interface ExtractAsyncParams {
1556
1556
  */
1557
1557
  parser?: { [key: string]: unknown } | string;
1558
1558
 
1559
+ /**
1560
+ * Overall deadline in milliseconds for a realtime request. Clamped to the account
1561
+ * total timeout — it can shorten the deadline but never extend it. Has no effect
1562
+ * on async requests.
1563
+ */
1564
+ realtime_total_timeout?: number;
1565
+
1559
1566
  /**
1560
1567
  * Referrer policy for the request
1561
1568
  */
@@ -2700,6 +2707,13 @@ export namespace ExtractBatchParams {
2700
2707
  */
2701
2708
  parser?: { [key: string]: unknown } | string;
2702
2709
 
2710
+ /**
2711
+ * Overall deadline in milliseconds for a realtime request. Clamped to the account
2712
+ * total timeout — it can shorten the deadline but never extend it. Has no effect
2713
+ * on async requests.
2714
+ */
2715
+ realtime_total_timeout?: number;
2716
+
2703
2717
  /**
2704
2718
  * Referrer policy for the request
2705
2719
  */
@@ -3839,6 +3853,13 @@ export namespace ExtractBatchParams {
3839
3853
  */
3840
3854
  parser?: { [key: string]: unknown } | string;
3841
3855
 
3856
+ /**
3857
+ * Overall deadline in milliseconds for a realtime request. Clamped to the account
3858
+ * total timeout — it can shorten the deadline but never extend it. Has no effect
3859
+ * on async requests.
3860
+ */
3861
+ realtime_total_timeout?: number;
3862
+
3842
3863
  /**
3843
3864
  * Referrer policy for the request
3844
3865
  */
@@ -4974,6 +4995,13 @@ export interface ExtractRunParams {
4974
4995
  */
4975
4996
  parser?: { [key: string]: unknown } | string;
4976
4997
 
4998
+ /**
4999
+ * Overall deadline in milliseconds for a realtime request. Clamped to the account
5000
+ * total timeout — it can shorten the deadline but never extend it. Has no effect
5001
+ * on async requests.
5002
+ */
5003
+ realtime_total_timeout?: number;
5004
+
4977
5005
  /**
4978
5006
  * Referrer policy for the request
4979
5007
  */
@@ -163,6 +163,13 @@ export namespace JobCreateResponse {
163
163
  * types.
164
164
  */
165
165
  file_path?: string | null;
166
+
167
+ /**
168
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
169
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
170
+ * input file. Mutually exclusive with 'data'.
171
+ */
172
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
166
173
  }
167
174
 
168
175
  /**
@@ -287,6 +294,13 @@ export namespace JobUpdateResponse {
287
294
  * types.
288
295
  */
289
296
  file_path?: string | null;
297
+
298
+ /**
299
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
300
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
301
+ * input file. Mutually exclusive with 'data'.
302
+ */
303
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
290
304
  }
291
305
 
292
306
  /**
@@ -442,6 +456,13 @@ export namespace JobListResponse {
442
456
  * types.
443
457
  */
444
458
  file_path?: string | null;
459
+
460
+ /**
461
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
462
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
463
+ * input file. Mutually exclusive with 'data'.
464
+ */
465
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
445
466
  }
446
467
 
447
468
  /**
@@ -567,6 +588,13 @@ export namespace JobGetResponse {
567
588
  * types.
568
589
  */
569
590
  file_path?: string | null;
591
+
592
+ /**
593
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
594
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
595
+ * input file. Mutually exclusive with 'data'.
596
+ */
597
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
570
598
  }
571
599
 
572
600
  /**
@@ -663,6 +691,13 @@ export namespace JobCreateParams {
663
691
  * types.
664
692
  */
665
693
  file_path?: string | null;
694
+
695
+ /**
696
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
697
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
698
+ * input file. Mutually exclusive with 'data'.
699
+ */
700
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
666
701
  }
667
702
 
668
703
  /**
@@ -749,6 +784,13 @@ export namespace JobUpdateParams {
749
784
  * types.
750
785
  */
751
786
  file_path?: string | null;
787
+
788
+ /**
789
+ * Inline input records keyed by source node id, e.g. {'source_a': [{...}]}. Used
790
+ * when type is 'inline' on a dynamic-workflow job, which has one source node per
791
+ * input file. Mutually exclusive with 'data'.
792
+ */
793
+ node_data?: { [key: string]: Array<{ [key: string]: unknown }> } | null;
752
794
  }
753
795
 
754
796
  /**
@@ -985,6 +985,14 @@ export interface SearchParams {
985
985
  */
986
986
  focus?: string | Array<string>;
987
987
 
988
+ /**
989
+ * Return richer per-result content on the fast path. With search_depth='fast',
990
+ * enables live crawling of both web and news sources so results carry full
991
+ * markdown content instead of snippets only. Higher recall and cost. Ignored for
992
+ * other search_depth values.
993
+ */
994
+ full_content?: boolean;
995
+
988
996
  /**
989
997
  * Generate an LLM-powered answer summary based on search result snippets.
990
998
  */
@@ -0,0 +1,2 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from './core/streaming';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.1.0'; // x-release-please-version
1
+ export const VERSION = '1.3.0'; // x-release-please-version
@@ -0,0 +1,3 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from "./core/streaming.mjs";
3
+ //# sourceMappingURL=streaming.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.d.mts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qCAAiC"}
package/streaming.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from "./core/streaming.js";
3
+ //# sourceMappingURL=streaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,oCAAiC"}
package/streaming.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
4
+ /** @deprecated Import from ./core/streaming instead */
5
+ tslib_1.__exportStar(require("./core/streaming.js"), exports);
6
+ //# sourceMappingURL=streaming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,8DAAiC"}
package/streaming.mjs ADDED
@@ -0,0 +1,3 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from "./core/streaming.mjs";
3
+ //# sourceMappingURL=streaming.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qCAAiC"}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.1.0";
1
+ export declare const VERSION = "1.3.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.1.0";
1
+ export declare const VERSION = "1.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.1.0'; // x-release-please-version
4
+ exports.VERSION = '1.3.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.1.0'; // x-release-please-version
1
+ export const VERSION = '1.3.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map