@parcha/agentrun 0.2.0 → 0.2.1
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.
- package/CHANGELOG.md +5 -0
- package/README.md +8 -3
- package/dist/index.cjs +17 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ declare function parseBatchCSV(csv: string, inputColumn?: string): {
|
|
|
20
20
|
* Nothing here retries, follows redirects, or logs the API key.
|
|
21
21
|
*/
|
|
22
22
|
declare const DEFAULT_BASE_URL = "https://api.grep.ai/api/v2";
|
|
23
|
-
declare const VERSION = "0.2.
|
|
23
|
+
declare const VERSION = "0.2.1";
|
|
24
24
|
interface Op<T> {
|
|
25
25
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
26
26
|
path: string;
|
|
@@ -103,6 +103,12 @@ interface AgentRecord {
|
|
|
103
103
|
description?: string | null;
|
|
104
104
|
domain?: string | null;
|
|
105
105
|
is_public?: boolean;
|
|
106
|
+
/** The agent's instructions, as passed to `new Agent({ instructions })`. Same value as `system_prompt`. */
|
|
107
|
+
instructions: string | null;
|
|
108
|
+
/** Skill names, as passed to `new Agent({ skills })`. Same value as `skill_names`. */
|
|
109
|
+
skills: string[];
|
|
110
|
+
/** Tool names, as passed to `new Agent({ tools })`. Same value as `mcp_tool_names`. */
|
|
111
|
+
tools: string[];
|
|
106
112
|
skill_names: string[];
|
|
107
113
|
mcp_tool_names: string[];
|
|
108
114
|
system_prompt?: string | null;
|
|
@@ -185,6 +191,21 @@ interface BatchRow {
|
|
|
185
191
|
structured_output?: Wire$1 | null;
|
|
186
192
|
[key: string]: unknown;
|
|
187
193
|
}
|
|
194
|
+
/** A row from `getBatchResults`. Inputs (`question`, `row_data`) are on `getBatch(id).rows`. */
|
|
195
|
+
interface BatchResultRow {
|
|
196
|
+
row_number: number;
|
|
197
|
+
status: RowStatus | string;
|
|
198
|
+
raw_status: string | null;
|
|
199
|
+
run_id?: string | null;
|
|
200
|
+
headline?: string | null;
|
|
201
|
+
excerpt?: string | null;
|
|
202
|
+
report_link?: string | null;
|
|
203
|
+
is_public?: boolean;
|
|
204
|
+
structured_output?: Wire$1 | null;
|
|
205
|
+
error_code?: string | null;
|
|
206
|
+
error_message?: string | null;
|
|
207
|
+
[key: string]: unknown;
|
|
208
|
+
}
|
|
188
209
|
interface Batch {
|
|
189
210
|
id: string;
|
|
190
211
|
/** SDK vocabulary. See `BatchStatus`. */
|
|
@@ -202,7 +223,7 @@ interface Batch {
|
|
|
202
223
|
[key: string]: unknown;
|
|
203
224
|
}
|
|
204
225
|
interface BatchResults extends Batch {
|
|
205
|
-
results:
|
|
226
|
+
results: BatchResultRow[];
|
|
206
227
|
}
|
|
207
228
|
interface RetryResult extends Batch {
|
|
208
229
|
retried_rows?: number | null;
|
|
@@ -658,4 +679,4 @@ declare class PollTimeoutError extends AgentRunError {
|
|
|
658
679
|
name: string;
|
|
659
680
|
}
|
|
660
681
|
|
|
661
|
-
export { APIConnectionError, APIError, APITimeoutError, Agent, type AgentBuild, type AgentDefinition, type AgentOptions, type AgentRecord, AgentRun, AgentRunError, Artifact, AuthenticationError, BATCH_STATUS_MAP, BATCH_TERMINAL_STATUSES, type Batch, type BatchCSV, type BatchOptions, type BatchResults, type BatchRow, type BatchStatus, type BuildDepth, BuildError, CAMPAIGN_TERMINAL_STATUSES, type Campaign, type CampaignPortfolio, type CancelResult, type ClientOptions, ConflictError, DEFAULT_BASE_URL, type Effort, type InputField, type Integration, type IntegrationList, InternalServerError, InvalidResponseError, type Loop, type LoopCadence, type LoopCreated, type LoopDetail, type LoopFrequency, type LoopRun, type LoopRunNow, MAX_CSV_BYTES, MAX_INPUTS, MAX_INPUT_CHARS, NotFoundError, type Page, PermissionDeniedError, PollTimeoutError, type PortfolioFilter, type PortfolioStatus, ROW_STATUS_MAP, RUN_STATUS_MAP, RUN_TERMINAL_STATUSES, RateLimitError, type Report, type RequestOptions, type RetryResult, type RowStatus, type Run, type RunOptions, type RunStatus, type RunSummary, type SchemaLike, ServiceUnavailableError, Skill, type SkillContent, type SkillList, type SkillRecord, type SkillSummary, UnprocessableEntityError, type Usage, VERSION, type WaitOptions, parseBatchCSV };
|
|
682
|
+
export { APIConnectionError, APIError, APITimeoutError, Agent, type AgentBuild, type AgentDefinition, type AgentOptions, type AgentRecord, AgentRun, AgentRunError, Artifact, AuthenticationError, BATCH_STATUS_MAP, BATCH_TERMINAL_STATUSES, type Batch, type BatchCSV, type BatchOptions, type BatchResultRow, type BatchResults, type BatchRow, type BatchStatus, type BuildDepth, BuildError, CAMPAIGN_TERMINAL_STATUSES, type Campaign, type CampaignPortfolio, type CancelResult, type ClientOptions, ConflictError, DEFAULT_BASE_URL, type Effort, type InputField, type Integration, type IntegrationList, InternalServerError, InvalidResponseError, type Loop, type LoopCadence, type LoopCreated, type LoopDetail, type LoopFrequency, type LoopRun, type LoopRunNow, MAX_CSV_BYTES, MAX_INPUTS, MAX_INPUT_CHARS, NotFoundError, type Page, PermissionDeniedError, PollTimeoutError, type PortfolioFilter, type PortfolioStatus, ROW_STATUS_MAP, RUN_STATUS_MAP, RUN_TERMINAL_STATUSES, RateLimitError, type Report, type RequestOptions, type RetryResult, type RowStatus, type Run, type RunOptions, type RunStatus, type RunSummary, type SchemaLike, ServiceUnavailableError, Skill, type SkillContent, type SkillList, type SkillRecord, type SkillSummary, UnprocessableEntityError, type Usage, VERSION, type WaitOptions, parseBatchCSV };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare function parseBatchCSV(csv: string, inputColumn?: string): {
|
|
|
20
20
|
* Nothing here retries, follows redirects, or logs the API key.
|
|
21
21
|
*/
|
|
22
22
|
declare const DEFAULT_BASE_URL = "https://api.grep.ai/api/v2";
|
|
23
|
-
declare const VERSION = "0.2.
|
|
23
|
+
declare const VERSION = "0.2.1";
|
|
24
24
|
interface Op<T> {
|
|
25
25
|
method: "GET" | "POST" | "PATCH" | "DELETE";
|
|
26
26
|
path: string;
|
|
@@ -103,6 +103,12 @@ interface AgentRecord {
|
|
|
103
103
|
description?: string | null;
|
|
104
104
|
domain?: string | null;
|
|
105
105
|
is_public?: boolean;
|
|
106
|
+
/** The agent's instructions, as passed to `new Agent({ instructions })`. Same value as `system_prompt`. */
|
|
107
|
+
instructions: string | null;
|
|
108
|
+
/** Skill names, as passed to `new Agent({ skills })`. Same value as `skill_names`. */
|
|
109
|
+
skills: string[];
|
|
110
|
+
/** Tool names, as passed to `new Agent({ tools })`. Same value as `mcp_tool_names`. */
|
|
111
|
+
tools: string[];
|
|
106
112
|
skill_names: string[];
|
|
107
113
|
mcp_tool_names: string[];
|
|
108
114
|
system_prompt?: string | null;
|
|
@@ -185,6 +191,21 @@ interface BatchRow {
|
|
|
185
191
|
structured_output?: Wire$1 | null;
|
|
186
192
|
[key: string]: unknown;
|
|
187
193
|
}
|
|
194
|
+
/** A row from `getBatchResults`. Inputs (`question`, `row_data`) are on `getBatch(id).rows`. */
|
|
195
|
+
interface BatchResultRow {
|
|
196
|
+
row_number: number;
|
|
197
|
+
status: RowStatus | string;
|
|
198
|
+
raw_status: string | null;
|
|
199
|
+
run_id?: string | null;
|
|
200
|
+
headline?: string | null;
|
|
201
|
+
excerpt?: string | null;
|
|
202
|
+
report_link?: string | null;
|
|
203
|
+
is_public?: boolean;
|
|
204
|
+
structured_output?: Wire$1 | null;
|
|
205
|
+
error_code?: string | null;
|
|
206
|
+
error_message?: string | null;
|
|
207
|
+
[key: string]: unknown;
|
|
208
|
+
}
|
|
188
209
|
interface Batch {
|
|
189
210
|
id: string;
|
|
190
211
|
/** SDK vocabulary. See `BatchStatus`. */
|
|
@@ -202,7 +223,7 @@ interface Batch {
|
|
|
202
223
|
[key: string]: unknown;
|
|
203
224
|
}
|
|
204
225
|
interface BatchResults extends Batch {
|
|
205
|
-
results:
|
|
226
|
+
results: BatchResultRow[];
|
|
206
227
|
}
|
|
207
228
|
interface RetryResult extends Batch {
|
|
208
229
|
retried_rows?: number | null;
|
|
@@ -658,4 +679,4 @@ declare class PollTimeoutError extends AgentRunError {
|
|
|
658
679
|
name: string;
|
|
659
680
|
}
|
|
660
681
|
|
|
661
|
-
export { APIConnectionError, APIError, APITimeoutError, Agent, type AgentBuild, type AgentDefinition, type AgentOptions, type AgentRecord, AgentRun, AgentRunError, Artifact, AuthenticationError, BATCH_STATUS_MAP, BATCH_TERMINAL_STATUSES, type Batch, type BatchCSV, type BatchOptions, type BatchResults, type BatchRow, type BatchStatus, type BuildDepth, BuildError, CAMPAIGN_TERMINAL_STATUSES, type Campaign, type CampaignPortfolio, type CancelResult, type ClientOptions, ConflictError, DEFAULT_BASE_URL, type Effort, type InputField, type Integration, type IntegrationList, InternalServerError, InvalidResponseError, type Loop, type LoopCadence, type LoopCreated, type LoopDetail, type LoopFrequency, type LoopRun, type LoopRunNow, MAX_CSV_BYTES, MAX_INPUTS, MAX_INPUT_CHARS, NotFoundError, type Page, PermissionDeniedError, PollTimeoutError, type PortfolioFilter, type PortfolioStatus, ROW_STATUS_MAP, RUN_STATUS_MAP, RUN_TERMINAL_STATUSES, RateLimitError, type Report, type RequestOptions, type RetryResult, type RowStatus, type Run, type RunOptions, type RunStatus, type RunSummary, type SchemaLike, ServiceUnavailableError, Skill, type SkillContent, type SkillList, type SkillRecord, type SkillSummary, UnprocessableEntityError, type Usage, VERSION, type WaitOptions, parseBatchCSV };
|
|
682
|
+
export { APIConnectionError, APIError, APITimeoutError, Agent, type AgentBuild, type AgentDefinition, type AgentOptions, type AgentRecord, AgentRun, AgentRunError, Artifact, AuthenticationError, BATCH_STATUS_MAP, BATCH_TERMINAL_STATUSES, type Batch, type BatchCSV, type BatchOptions, type BatchResultRow, type BatchResults, type BatchRow, type BatchStatus, type BuildDepth, BuildError, CAMPAIGN_TERMINAL_STATUSES, type Campaign, type CampaignPortfolio, type CancelResult, type ClientOptions, ConflictError, DEFAULT_BASE_URL, type Effort, type InputField, type Integration, type IntegrationList, InternalServerError, InvalidResponseError, type Loop, type LoopCadence, type LoopCreated, type LoopDetail, type LoopFrequency, type LoopRun, type LoopRunNow, MAX_CSV_BYTES, MAX_INPUTS, MAX_INPUT_CHARS, NotFoundError, type Page, PermissionDeniedError, PollTimeoutError, type PortfolioFilter, type PortfolioStatus, ROW_STATUS_MAP, RUN_STATUS_MAP, RUN_TERMINAL_STATUSES, RateLimitError, type Report, type RequestOptions, type RetryResult, type RowStatus, type Run, type RunOptions, type RunStatus, type RunSummary, type SchemaLike, ServiceUnavailableError, Skill, type SkillContent, type SkillList, type SkillRecord, type SkillSummary, UnprocessableEntityError, type Usage, VERSION, type WaitOptions, parseBatchCSV };
|
package/dist/index.js
CHANGED
|
@@ -278,13 +278,18 @@ function isWire(value) {
|
|
|
278
278
|
}
|
|
279
279
|
var parse = {
|
|
280
280
|
agent(wire) {
|
|
281
|
+
const skills = Array.isArray(wire.skill_names) ? wire.skill_names : [];
|
|
282
|
+
const tools = Array.isArray(wire.mcp_tool_names) ? wire.mcp_tool_names : [];
|
|
281
283
|
return {
|
|
282
284
|
...wire,
|
|
283
285
|
id: requireId(wire, "agent", "id"),
|
|
284
286
|
name: str(wire.name) ?? "",
|
|
285
287
|
status: str(wire.status) ?? "",
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
instructions: str(wire.system_prompt),
|
|
289
|
+
skills,
|
|
290
|
+
tools,
|
|
291
|
+
skill_names: skills,
|
|
292
|
+
mcp_tool_names: tools,
|
|
288
293
|
input_form: Array.isArray(wire.input_form) ? wire.input_form : []
|
|
289
294
|
};
|
|
290
295
|
},
|
|
@@ -348,8 +353,16 @@ var parse = {
|
|
|
348
353
|
rows: list(wire.rows, parse.row)
|
|
349
354
|
};
|
|
350
355
|
},
|
|
356
|
+
resultRow(wire) {
|
|
357
|
+
return {
|
|
358
|
+
...wire,
|
|
359
|
+
row_number: Number(wire.row_number ?? 0),
|
|
360
|
+
...mapStatus(wire, ROW_STATUS_MAP, "status"),
|
|
361
|
+
run_id: firstString(wire, "job_id", "run_id")
|
|
362
|
+
};
|
|
363
|
+
},
|
|
351
364
|
batchResults(wire) {
|
|
352
|
-
return { ...parse.batch(wire), results: list(wire.results, parse.
|
|
365
|
+
return { ...parse.batch(wire), results: list(wire.results, parse.resultRow) };
|
|
353
366
|
},
|
|
354
367
|
retry(wire) {
|
|
355
368
|
return parse.batch(wire);
|
|
@@ -453,7 +466,7 @@ var parse = {
|
|
|
453
466
|
// src/http.ts
|
|
454
467
|
var DEFAULT_BASE_URL = "https://api.grep.ai/api/v2";
|
|
455
468
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
456
|
-
var VERSION = "0.2.
|
|
469
|
+
var VERSION = "0.2.1";
|
|
457
470
|
var LOCAL_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
458
471
|
function env(name) {
|
|
459
472
|
const g = globalThis;
|