@frontera-sdk/functions 1.50.57 → 1.50.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontera-sdk/functions",
3
- "version": "1.50.57",
3
+ "version": "1.50.59",
4
4
  "description": "Author Frontera functions: manifest, triggers and the typed handler contract.",
5
5
  "keywords": [
6
6
  "frontera",
@@ -42,7 +42,7 @@
42
42
  "typescript": "^5.9.3"
43
43
  },
44
44
  "dependencies": {
45
- "@frontera-sdk/blueprint": "1.50.57",
45
+ "@frontera-sdk/blueprint": "1.50.59",
46
46
  "cron-parser": "^5.0.6"
47
47
  }
48
48
  }
@@ -575,7 +575,7 @@ export function buildContext(deps: Deps): AutomationContext {
575
575
 
576
576
  agent(slug: string) {
577
577
  return {
578
- run: (prompt: string, options?: { files?: Array<{ fileId: string }> }) =>
578
+ run: (prompt: string, options?: { files?: Array<{ fileId: string }>; timeoutMs?: number }) =>
579
579
  step('agent', `agent:${slug}`, async () => {
580
580
  requireGrant(`agent:${slug}:run`)
581
581
  // `files` hands the agent already-uploaded files by canonical id —
@@ -590,6 +590,7 @@ export function buildContext(deps: Deps): AutomationContext {
590
590
  slug,
591
591
  prompt,
592
592
  ...(options?.files?.length ? { files: options.files.map((f) => ({ fileId: f.fileId })) } : {}),
593
+ ...(options?.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),
593
594
  }),
594
595
  })
595
596
  if (!res.ok) throw new Error(`agent ${slug} → ${res.status} ${await refusal(res)}`)
package/src/types.ts CHANGED
@@ -216,8 +216,12 @@ export interface AgentHandle {
216
216
  * carries, so an input forwards directly: `run(p, { files: [ctx.input.doc] })`.
217
217
  * Each id is authorized against this run's workspace and the bytes are staged
218
218
  * onto the agent's computer; the agent is told the staged paths.
219
+ *
220
+ * `options.timeoutMs` waits longer than the default 120 s for work known to
221
+ * be long (a long scanned document); the service caps it at 480 s, under
222
+ * the run's own 10-minute ceiling.
219
223
  */
220
- run(prompt: string, options?: { files?: readonly FileRef[] }): Promise<{ text: string }>
224
+ run(prompt: string, options?: { files?: readonly FileRef[]; timeoutMs?: number }): Promise<{ text: string }>
221
225
  }
222
226
 
223
227
  /**