@parall/agent-core 1.25.0 → 1.26.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.
- package/dist/bridge-workspace.d.ts +1 -1
- package/dist/bridge-workspace.d.ts.map +1 -1
- package/dist/bridge-workspace.js +1 -1
- package/dist/dispatch-adapter.d.ts +2 -0
- package/dist/dispatch-adapter.d.ts.map +1 -1
- package/dist/gateway-base.d.ts +6 -0
- package/dist/gateway-base.d.ts.map +1 -1
- package/dist/gateway-base.js +53 -7
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/platform-config.d.ts +23 -0
- package/dist/platform-config.d.ts.map +1 -0
- package/dist/platform-config.js +105 -0
- package/dist/skills/index.d.ts +14 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +44 -0
- package/dist/skills/parall-platform.d.ts +2 -0
- package/dist/skills/parall-platform.d.ts.map +1 -0
- package/dist/skills/parall-platform.js +161 -0
- package/dist/skills/parall-schedules.d.ts +2 -0
- package/dist/skills/parall-schedules.d.ts.map +1 -0
- package/dist/skills/parall-schedules.js +80 -0
- package/dist/skills/parall-tasks.d.ts +2 -0
- package/dist/skills/parall-tasks.d.ts.map +1 -0
- package/dist/skills/parall-tasks.js +65 -0
- package/dist/skills/parall-wiki.d.ts +2 -0
- package/dist/skills/parall-wiki.d.ts.map +1 -0
- package/dist/skills/parall-wiki.js +131 -0
- package/package.json +2 -2
- package/src/bridge-workspace.ts +1 -1
- package/src/dispatch-adapter.ts +2 -0
- package/src/gateway-base.ts +53 -7
- package/src/index.ts +3 -0
- package/src/platform-config.ts +159 -0
- package/src/skills/index.ts +52 -0
- package/src/skills/parall-platform.ts +161 -0
- package/src/skills/parall-schedules.ts +80 -0
- package/src/skills/parall-tasks.ts +65 -0
- package/src/skills/parall-wiki.ts +131 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `@parall/agent-core` stays runtime-neutral and exports only text + pure
|
|
8
8
|
* helpers here.
|
|
9
9
|
*/
|
|
10
|
-
export declare const BRIDGE_WORKSPACE_INSTRUCTIONS = "# Agent workspace\n\nYou are an agent in Parall IM. You participate in chats, handle tasks, and interact exclusively through the Parall CLI.\n\n## Message Model\n\nIncoming events are rendered as structured `[Event: ...]` blocks.\nEach event includes `[Chat: ... (prll://cht_xxx)]` \u2014 use that chat ID (or full URI) when replying.\n\n**Your plain-text output is not delivered to anyone** \u2014 it is recorded as suppressed thinking in your session steps and discarded from the chat.\nTo say something in a chat, you **must** invoke the Parall CLI via your shell/exec tool. To stay silent, simply do not invoke it.\n\n## Parall CLI\n\nAll outbound interactions go through the `parall` CLI. Credentials are pre-injected as environment variables \u2014 no setup needed. If `parall` is not on PATH, use `npx --yes @parall/cli@latest` instead.\n\n- `parall messages send prll://cht_xxx --text \"...\"` \u2014 reply into the triggering chat\n- `parall dm prll://usr_xxx --text \"...\" [--no-reply]` \u2014 direct message another user\n- `parall tasks update prll://tsk_xxx --status in_progress` \u2014 task state\n- `parall no-reply [--reason \"...\"]` \u2014 explicitly declare this turn silent (audit signal; not required for silence, just clarifies intent)\n\nThe bridge injects Parall context via environment variables. The static credentials `PRLL_API_URL`, `PRLL_API_KEY`, and `PRLL_ORG_ID` are always set.
|
|
10
|
+
export declare const BRIDGE_WORKSPACE_INSTRUCTIONS = "# Agent workspace\n\nYou are an agent in Parall IM. You participate in chats, handle tasks, and interact exclusively through the Parall CLI.\n\n## Message Model\n\nIncoming events are rendered as structured `[Event: ...]` blocks.\nEach event includes `[Chat: ... (prll://cht_xxx)]` \u2014 use that chat ID (or full URI) when replying.\n\n**Your plain-text output is not delivered to anyone** \u2014 it is recorded as suppressed thinking in your session steps and discarded from the chat.\nTo say something in a chat, you **must** invoke the Parall CLI via your shell/exec tool. To stay silent, simply do not invoke it.\n\n## Parall CLI\n\nAll outbound interactions go through the `parall` CLI. Credentials are pre-injected as environment variables \u2014 no setup needed. If `parall` is not on PATH, use `npx --yes @parall/cli@latest` instead.\n\n- `parall messages send prll://cht_xxx --text \"...\"` \u2014 reply into the triggering chat\n- `parall dm prll://usr_xxx --text \"...\" [--no-reply]` \u2014 direct message another user\n- `parall tasks update prll://tsk_xxx --status in_progress` \u2014 task state\n- `parall no-reply [--reason \"...\"]` \u2014 explicitly declare this turn silent (audit signal; not required for silence, just clarifies intent)\n\nThe bridge injects Parall context via environment variables. The static credentials `PRLL_API_URL`, `PRLL_API_KEY`, and `PRLL_ORG_ID` are always set. `PRLL_CONTEXT_FILE` points to a per-session JSON file that the gateway updates each dispatch with `session_id`, `chat_id`, `trigger_message_id`, `no_reply`, and `step_id` (updated per tool call). The CLI reads this file automatically \u2014 you do not need to pass `--chat` or `--session` explicitly when the context file is present.\n\n## Attachments\n\nImage attachments are pre-downloaded under `.parall/attachments/<messageId>/`. Each event's `[Local attachment files]` block lists each image as a metadata header followed by its absolute local path on its own line \u2014 pass that path to your file-reading tool when the user refers to image contents.\n\nSupported image types: PNG, JPEG, WebP, GIF. Other attachment types (PDFs, archives, etc.) are not pre-downloaded \u2014 fetch them on demand with `parall files download att_xxx --output ...`.\n\n## Guardrails\n\n- A dispatch may coalesce multiple events. Decide per event whether to reply via `messages send` / `dm` \u2014 events you do not act on simply receive no reply.\n- If an event carries `[Hint: no_reply]`, do not send anything for that event. `no-reply` is optional and only useful as an explicit intent marker.\n- Never try to \"speak\" by typing sentences like \"No response needed\" / \"Noted\" / \"OK\" \u2014 they are discarded, so they accomplish nothing except polluting your session log.\n- Keep CLI replies concise and task-focused.\n\nSee `docs/engineering-design/agent-dm-loop-prevention.md` \u00A7 Layer 0 for why plain text is never auto-projected.\n\n## Approval Flow\n\nWhen you try an action (e.g., archive a chat) and receive a PERMISSION_DENIED error, you can request someone with permission to do it:\n\n1. The error includes a `PERMISSION_DENIED` code. For commonly approvable actions (archive, delete, restore), a `Tip:` line with an approval-request template is printed \u2014 copy it and fill in the remaining placeholders (`--chat`, `--title`, `--reason`)\n2. Request approval: `parall approvals request --action chat.archive --resource prll://cht_123 --chat prll://cht_456 --title \"Archive #old-project\" --reason \"Channel inactive\"`\n3. A card will appear in the specified chat for someone with permission to approve\n4. Check the result: `parall approvals get prll://<id>` or wait: `parall approvals wait prll://<id> --timeout 300`\n5. List available actions: `parall approvals actions`\n\nOnly request approval when you've actually been denied permission. Don't request approval preemptively.\n";
|
|
11
11
|
/** Extracts the `command` string from a shell/bash tool call's input payload. */
|
|
12
12
|
export declare function extractShellCommand(input: unknown): string | undefined;
|
|
13
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-workspace.d.ts","sourceRoot":"","sources":["../src/bridge-workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"bridge-workspace.d.ts","sourceRoot":"","sources":["../src/bridge-workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,6BAA6B,00HAiDzC,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAItE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAmBzE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI3E"}
|
package/dist/bridge-workspace.js
CHANGED
|
@@ -28,7 +28,7 @@ All outbound interactions go through the \`parall\` CLI. Credentials are pre-inj
|
|
|
28
28
|
- \`parall tasks update prll://tsk_xxx --status in_progress\` — task state
|
|
29
29
|
- \`parall no-reply [--reason "..."]\` — explicitly declare this turn silent (audit signal; not required for silence, just clarifies intent)
|
|
30
30
|
|
|
31
|
-
The bridge injects Parall context via environment variables. The static credentials \`PRLL_API_URL\`, \`PRLL_API_KEY\`, and \`PRLL_ORG_ID\` are always set.
|
|
31
|
+
The bridge injects Parall context via environment variables. The static credentials \`PRLL_API_URL\`, \`PRLL_API_KEY\`, and \`PRLL_ORG_ID\` are always set. \`PRLL_CONTEXT_FILE\` points to a per-session JSON file that the gateway updates each dispatch with \`session_id\`, \`chat_id\`, \`trigger_message_id\`, \`no_reply\`, and \`step_id\` (updated per tool call). The CLI reads this file automatically — you do not need to pass \`--chat\` or \`--session\` explicitly when the context file is present.
|
|
32
32
|
|
|
33
33
|
## Attachments
|
|
34
34
|
|
|
@@ -17,6 +17,8 @@ export type DispatchContext = {
|
|
|
17
17
|
chatId?: string;
|
|
18
18
|
triggerMessageId?: string;
|
|
19
19
|
noReply: boolean;
|
|
20
|
+
contextFilePath?: string;
|
|
21
|
+
/** @deprecated Use contextFilePath. Kept for runtimes that haven't migrated. */
|
|
20
22
|
stepIdFilePath?: string;
|
|
21
23
|
client: ParallClient;
|
|
22
24
|
log?: GatewayLogger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch-adapter.d.ts","sourceRoot":"","sources":["../src/dispatch-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,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number;
|
|
21
21
|
shutdownDeadlineMs?: number;
|
|
22
|
+
contextFilePathForSession?: (sessionKey: string) => string | undefined;
|
|
23
|
+
/** @deprecated Use contextFilePathForSession. Kept for runtimes that haven't migrated. */
|
|
22
24
|
stepIdFilePathForSession?: (sessionKey: string) => string | undefined;
|
|
23
25
|
onConfigUpdate?: (data: AgentConfigUpdateData) => Promise<void> | void;
|
|
24
26
|
onSessionReady?: (state: {
|
|
@@ -57,7 +59,11 @@ export declare class ParallAgentGateway {
|
|
|
57
59
|
private buildDispatchContext;
|
|
58
60
|
private createInputStep;
|
|
59
61
|
private createRuntimeStep;
|
|
62
|
+
private writeContextFile;
|
|
63
|
+
private updateContextFileStepId;
|
|
64
|
+
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
60
65
|
private writeStepIdFile;
|
|
66
|
+
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
61
67
|
private clearStepIdFile;
|
|
62
68
|
private createInputStepsForEarlierEvents;
|
|
63
69
|
private runDispatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-base.d.ts","sourceRoot":"","sources":["../src/gateway-base.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EACV,qBAAqB,EAYtB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAEV,eAAe,EAGf,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAoD/B,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;IACrB,EAAE,EAAE,QAAQ,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;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,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAS;IAMzB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,cAAc,CAAyB;IAE/C,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAQ;IAChD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAI9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;gBAEjB,IAAI,EAAE,oBAAoB;IAKjD,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAyHlD,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,oBAAoB;YAoBd,eAAe;YA6Bf,iBAAiB;IA0F/B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,uBAAuB;IAW/B,kEAAkE;IAClE,OAAO,CAAC,eAAe;IASvB,kEAAkE;IAClE,OAAO,CAAC,eAAe;YAQT,gCAAgC;YAUhC,WAAW;YAiGX,gBAAgB;YAkFhB,eAAe;YA6Ef,kBAAkB;YA+ElB,kBAAkB;YAkBlB,4BAA4B;YAoD5B,aAAa;YA+Bb,oBAAoB;YAoCpB,kBAAkB;YAwBlB,iBAAiB;IAiF/B;;;;;;;OAOG;YACW,0BAA0B;YAsB1B,kBAAkB;YAsClB,mBAAmB;YAkGnB,WAAW;IA6DzB,OAAO,CAAC,YAAY;YAiBN,QAAQ;CA4CvB"}
|
package/dist/gateway-base.js
CHANGED
|
@@ -265,6 +265,7 @@ export class ParallAgentGateway {
|
|
|
265
265
|
chatId: event.type === "message" ? event.targetId : undefined,
|
|
266
266
|
triggerMessageId: event.messageId,
|
|
267
267
|
noReply: event.noReply ?? false,
|
|
268
|
+
contextFilePath: this.opts.contextFilePathForSession?.(sessionKey),
|
|
268
269
|
stepIdFilePath: this.opts.stepIdFilePathForSession?.(sessionKey),
|
|
269
270
|
client: this.opts.client,
|
|
270
271
|
log: this.opts.log,
|
|
@@ -298,7 +299,7 @@ export class ParallAgentGateway {
|
|
|
298
299
|
this.opts.log?.warn(`parall[${this.opts.accountId}]: failed to create input step: ${String(err)}`);
|
|
299
300
|
}
|
|
300
301
|
}
|
|
301
|
-
async createRuntimeStep(event, runtimeEvent, stepIdFilePath) {
|
|
302
|
+
async createRuntimeStep(event, runtimeEvent, stepIdFilePath, contextFilePath) {
|
|
302
303
|
if (!this.activeSessionId)
|
|
303
304
|
return;
|
|
304
305
|
const target = resolveStepTarget(event);
|
|
@@ -341,7 +342,10 @@ export class ParallAgentGateway {
|
|
|
341
342
|
group_key: runtimeEvent.groupKey,
|
|
342
343
|
runtime_key: runtimeEvent.callId,
|
|
343
344
|
});
|
|
344
|
-
if (
|
|
345
|
+
if (contextFilePath) {
|
|
346
|
+
this.updateContextFileStepId(contextFilePath, step.id);
|
|
347
|
+
}
|
|
348
|
+
else if (stepIdFilePath) {
|
|
345
349
|
this.writeStepIdFile(stepIdFilePath, step.id);
|
|
346
350
|
}
|
|
347
351
|
break;
|
|
@@ -361,7 +365,10 @@ export class ParallAgentGateway {
|
|
|
361
365
|
},
|
|
362
366
|
group_key: runtimeEvent.groupKey,
|
|
363
367
|
});
|
|
364
|
-
if (
|
|
368
|
+
if (contextFilePath) {
|
|
369
|
+
this.updateContextFileStepId(contextFilePath, null);
|
|
370
|
+
}
|
|
371
|
+
else if (stepIdFilePath) {
|
|
365
372
|
this.clearStepIdFile(stepIdFilePath);
|
|
366
373
|
}
|
|
367
374
|
break;
|
|
@@ -380,6 +387,27 @@ export class ParallAgentGateway {
|
|
|
380
387
|
this.opts.log?.warn(`parall[${this.opts.accountId}]: failed to create ${runtimeEvent.type} step: ${String(err)}`);
|
|
381
388
|
}
|
|
382
389
|
}
|
|
390
|
+
writeContextFile(filePath, ctx) {
|
|
391
|
+
try {
|
|
392
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
393
|
+
fs.writeFileSync(filePath, JSON.stringify(ctx), "utf8");
|
|
394
|
+
}
|
|
395
|
+
catch (err) {
|
|
396
|
+
this.opts.log?.warn(`parall[${this.opts.accountId}]: failed to write context file ${filePath}: ${String(err)}`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
updateContextFileStepId(filePath, stepId) {
|
|
400
|
+
try {
|
|
401
|
+
const raw = fs.readFileSync(filePath, "utf8");
|
|
402
|
+
const ctx = JSON.parse(raw);
|
|
403
|
+
ctx.step_id = stepId;
|
|
404
|
+
fs.writeFileSync(filePath, JSON.stringify(ctx), "utf8");
|
|
405
|
+
}
|
|
406
|
+
catch (err) {
|
|
407
|
+
this.opts.log?.warn(`parall[${this.opts.accountId}]: failed to update context file step_id ${filePath}: ${String(err)}`);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
383
411
|
writeStepIdFile(filePath, stepId) {
|
|
384
412
|
try {
|
|
385
413
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
@@ -389,6 +417,7 @@ export class ParallAgentGateway {
|
|
|
389
417
|
this.opts.log?.warn(`parall[${this.opts.accountId}]: failed to write step id file ${filePath}: ${String(err)}`);
|
|
390
418
|
}
|
|
391
419
|
}
|
|
420
|
+
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
392
421
|
clearStepIdFile(filePath) {
|
|
393
422
|
try {
|
|
394
423
|
fs.writeFileSync(filePath, "", "utf8");
|
|
@@ -419,7 +448,17 @@ export class ParallAgentGateway {
|
|
|
419
448
|
setDispatchMessageId(sessionKey, event.messageId);
|
|
420
449
|
setDispatchNoReply(sessionKey, event.noReply ?? false);
|
|
421
450
|
const dispatchContext = this.buildDispatchContext(event, sessionKey);
|
|
451
|
+
const contextFilePath = dispatchContext.contextFilePath;
|
|
422
452
|
const stepIdFilePath = dispatchContext.stepIdFilePath;
|
|
453
|
+
if (contextFilePath) {
|
|
454
|
+
this.writeContextFile(contextFilePath, {
|
|
455
|
+
session_id: dispatchContext.sessionId ?? null,
|
|
456
|
+
chat_id: dispatchContext.chatId ?? null,
|
|
457
|
+
trigger_message_id: dispatchContext.triggerMessageId ?? null,
|
|
458
|
+
no_reply: dispatchContext.noReply,
|
|
459
|
+
step_id: null,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
423
462
|
// sync: no await between the shuttingDown check above and this increment
|
|
424
463
|
// — JS event loop is single-threaded, so shutdown() cannot interleave
|
|
425
464
|
// here and miss our in-flight count.
|
|
@@ -448,21 +487,24 @@ export class ParallAgentGateway {
|
|
|
448
487
|
sessionKey,
|
|
449
488
|
context: dispatchContext,
|
|
450
489
|
})) {
|
|
451
|
-
await this.createRuntimeStep(event, runtimeEvent, stepIdFilePath);
|
|
490
|
+
await this.createRuntimeStep(event, runtimeEvent, stepIdFilePath, contextFilePath);
|
|
452
491
|
}
|
|
453
492
|
}
|
|
454
493
|
catch (err) {
|
|
455
494
|
await this.createRuntimeStep(event, {
|
|
456
495
|
type: "error",
|
|
457
496
|
message: `Dispatch failed: ${String(err)}`,
|
|
458
|
-
}, stepIdFilePath);
|
|
497
|
+
}, stepIdFilePath, contextFilePath);
|
|
459
498
|
throw err;
|
|
460
499
|
}
|
|
461
500
|
finally {
|
|
462
501
|
clearSessionMessageId(sessionKey);
|
|
463
502
|
clearDispatchMessageId(sessionKey);
|
|
464
503
|
clearDispatchNoReply(sessionKey);
|
|
465
|
-
if (
|
|
504
|
+
if (contextFilePath) {
|
|
505
|
+
this.updateContextFileStepId(contextFilePath, null);
|
|
506
|
+
}
|
|
507
|
+
else if (stepIdFilePath) {
|
|
466
508
|
this.clearStepIdFile(stepIdFilePath);
|
|
467
509
|
}
|
|
468
510
|
if (this.activeSessionId) {
|
|
@@ -661,9 +703,13 @@ export class ParallAgentGateway {
|
|
|
661
703
|
}
|
|
662
704
|
return dispatched;
|
|
663
705
|
}
|
|
664
|
-
case "buffer-main":
|
|
706
|
+
case "buffer-main": {
|
|
707
|
+
if (this.shuttingDown) {
|
|
708
|
+
return false;
|
|
709
|
+
}
|
|
665
710
|
this.dispatchState.mainBuffer.push(event);
|
|
666
711
|
return false;
|
|
712
|
+
}
|
|
667
713
|
case "buffer-fork": {
|
|
668
714
|
const activeFork = this.forkStates.get(event.targetId);
|
|
669
715
|
if (!activeFork) {
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,7 @@ export * from "./prompt-fragments.js";
|
|
|
6
6
|
export * from "./bridge-workspace.js";
|
|
7
7
|
export * from "./dispatch-adapter.js";
|
|
8
8
|
export * from "./gateway-base.js";
|
|
9
|
+
export * from "./platform-config.js";
|
|
10
|
+
export { writeSkillFiles, buildSkillReferences, SKILLS } from "./skills/index.js";
|
|
11
|
+
export type { SkillMeta } from "./skills/index.js";
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClF,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,3 +6,5 @@ export * from "./prompt-fragments.js";
|
|
|
6
6
|
export * from "./bridge-workspace.js";
|
|
7
7
|
export * from "./dispatch-adapter.js";
|
|
8
8
|
export * from "./gateway-base.js";
|
|
9
|
+
export * from "./platform-config.js";
|
|
10
|
+
export { writeSkillFiles, buildSkillReferences, SKILLS } from "./skills/index.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ParallClient } from "@parall/sdk";
|
|
2
|
+
import type { GatewayLogger } from "./dispatch-adapter.js";
|
|
3
|
+
export interface PlatformDefaults {
|
|
4
|
+
model: string | null;
|
|
5
|
+
thinkingEffort: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface PlatformConfigManager {
|
|
8
|
+
fetch(): Promise<PlatformDefaults>;
|
|
9
|
+
current(): PlatformDefaults;
|
|
10
|
+
rawConfig(): Record<string, unknown> | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PlatformManagementProfile {
|
|
13
|
+
machine_id?: string | null;
|
|
14
|
+
model_management?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function isPlatformManagedProfile(profile: PlatformManagementProfile | null | undefined): boolean;
|
|
17
|
+
export declare function createPlatformConfigManager(opts: {
|
|
18
|
+
client: ParallClient;
|
|
19
|
+
stateDir: string;
|
|
20
|
+
runtimeType?: string;
|
|
21
|
+
log?: GatewayLogger;
|
|
22
|
+
}): PlatformConfigManager;
|
|
23
|
+
//# sourceMappingURL=platform-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-config.d.ts","sourceRoot":"","sources":["../src/platform-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,aAAa,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,OAAO,IAAI,gBAAgB,CAAC;IAC5B,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEvG;AA8ED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB,GAAG,qBAAqB,CAoDxB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
export function isPlatformManagedProfile(profile) {
|
|
4
|
+
return profile?.machine_id != null || profile?.model_management === "platform";
|
|
5
|
+
}
|
|
6
|
+
const CACHE_FILENAME = "parall-platform-config.json";
|
|
7
|
+
const SUPPORTED_SCHEMA_VERSION = 1;
|
|
8
|
+
function cachePath(stateDir) {
|
|
9
|
+
return path.join(stateDir, CACHE_FILENAME);
|
|
10
|
+
}
|
|
11
|
+
function loadCache(stateDir) {
|
|
12
|
+
try {
|
|
13
|
+
const raw = fs.readFileSync(cachePath(stateDir), "utf-8");
|
|
14
|
+
return JSON.parse(raw);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function saveCache(stateDir, response) {
|
|
21
|
+
const cached = {
|
|
22
|
+
version: response.version,
|
|
23
|
+
config: response.config,
|
|
24
|
+
fetchedAt: new Date().toISOString(),
|
|
25
|
+
};
|
|
26
|
+
const filePath = cachePath(stateDir);
|
|
27
|
+
const tmpPath = `${filePath}.tmp`;
|
|
28
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
29
|
+
fs.writeFileSync(tmpPath, JSON.stringify(cached, null, 2), "utf-8");
|
|
30
|
+
fs.renameSync(tmpPath, filePath);
|
|
31
|
+
}
|
|
32
|
+
function runtimeModelName(canonicalModel, runtimeType, config) {
|
|
33
|
+
const runtime = runtimeType?.trim();
|
|
34
|
+
if (!runtime || runtime === "openclaw")
|
|
35
|
+
return canonicalModel;
|
|
36
|
+
const models = (config.models ?? {});
|
|
37
|
+
const providers = (models.providers ?? {});
|
|
38
|
+
const parall = (providers.parall ?? {});
|
|
39
|
+
const catalog = Array.isArray(parall.models) ? parall.models : [];
|
|
40
|
+
const match = catalog.find((model) => model.id === canonicalModel);
|
|
41
|
+
const runtimeNames = (match?.runtime_names ?? {});
|
|
42
|
+
const runtimeName = runtimeNames[runtime];
|
|
43
|
+
return typeof runtimeName === "string" && runtimeName ? runtimeName : null;
|
|
44
|
+
}
|
|
45
|
+
function extractDefaults(config, runtimeType) {
|
|
46
|
+
const agents = (config.agents ?? {});
|
|
47
|
+
const defaults = (agents.defaults ?? {});
|
|
48
|
+
let model = null;
|
|
49
|
+
if (typeof defaults.model === "string" && defaults.model) {
|
|
50
|
+
const canonicalModel = defaults.model.replace(/^parall\//, "");
|
|
51
|
+
model = runtimeModelName(canonicalModel, runtimeType, config);
|
|
52
|
+
}
|
|
53
|
+
let thinkingEffort = null;
|
|
54
|
+
if (typeof defaults.thinking_effort === "string" && defaults.thinking_effort) {
|
|
55
|
+
thinkingEffort = defaults.thinking_effort;
|
|
56
|
+
}
|
|
57
|
+
return { model, thinkingEffort };
|
|
58
|
+
}
|
|
59
|
+
export function createPlatformConfigManager(opts) {
|
|
60
|
+
const { client, stateDir, runtimeType, log } = opts;
|
|
61
|
+
let cachedVersion;
|
|
62
|
+
let currentDefaults = { model: null, thinkingEffort: null };
|
|
63
|
+
let currentRawConfig = null;
|
|
64
|
+
const cached = loadCache(stateDir);
|
|
65
|
+
if (cached) {
|
|
66
|
+
cachedVersion = cached.version;
|
|
67
|
+
currentRawConfig = cached.config;
|
|
68
|
+
currentDefaults = extractDefaults(cached.config, runtimeType);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
async fetch() {
|
|
72
|
+
let fresh = null;
|
|
73
|
+
try {
|
|
74
|
+
fresh = await client.getPlatformConfig(cachedVersion);
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (cached) {
|
|
78
|
+
log?.warn(`platform config fetch failed, using cached version ${cachedVersion}: ${String(err)}`);
|
|
79
|
+
return currentDefaults;
|
|
80
|
+
}
|
|
81
|
+
log?.warn(`platform config fetch failed and no cache available: ${String(err)}`);
|
|
82
|
+
return currentDefaults;
|
|
83
|
+
}
|
|
84
|
+
if (fresh === null) {
|
|
85
|
+
return currentDefaults;
|
|
86
|
+
}
|
|
87
|
+
if (fresh.schema_version !== undefined && fresh.schema_version > SUPPORTED_SCHEMA_VERSION) {
|
|
88
|
+
log?.warn(`platform config schema_version ${fresh.schema_version} > supported (${SUPPORTED_SCHEMA_VERSION}), keeping current`);
|
|
89
|
+
return currentDefaults;
|
|
90
|
+
}
|
|
91
|
+
log?.info(`platform config updated to version ${fresh.version}`);
|
|
92
|
+
saveCache(stateDir, fresh);
|
|
93
|
+
cachedVersion = fresh.version;
|
|
94
|
+
currentRawConfig = fresh.config;
|
|
95
|
+
currentDefaults = extractDefaults(fresh.config, runtimeType);
|
|
96
|
+
return currentDefaults;
|
|
97
|
+
},
|
|
98
|
+
current() {
|
|
99
|
+
return currentDefaults;
|
|
100
|
+
},
|
|
101
|
+
rawConfig() {
|
|
102
|
+
return currentRawConfig;
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { PARALL_PLATFORM_SKILL } from "./parall-platform.js";
|
|
2
|
+
export { PARALL_TASKS_SKILL } from "./parall-tasks.js";
|
|
3
|
+
export { PARALL_WIKI_SKILL } from "./parall-wiki.js";
|
|
4
|
+
export { PARALL_SCHEDULES_SKILL } from "./parall-schedules.js";
|
|
5
|
+
export type SkillMeta = {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
content: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const SKILLS: SkillMeta[];
|
|
11
|
+
/** Write plain skill markdown files to a target directory (CC/Codex). */
|
|
12
|
+
export declare function writeSkillFiles(targetDir: string): void;
|
|
13
|
+
export declare function buildSkillReferences(workspaceDir: string): string;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAO/D,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,MAAM,EAAE,SAAS,EAqB7B,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAKvD;AAGD,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAIjE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
export { PARALL_PLATFORM_SKILL } from "./parall-platform.js";
|
|
4
|
+
export { PARALL_TASKS_SKILL } from "./parall-tasks.js";
|
|
5
|
+
export { PARALL_WIKI_SKILL } from "./parall-wiki.js";
|
|
6
|
+
export { PARALL_SCHEDULES_SKILL } from "./parall-schedules.js";
|
|
7
|
+
import { PARALL_PLATFORM_SKILL } from "./parall-platform.js";
|
|
8
|
+
import { PARALL_TASKS_SKILL } from "./parall-tasks.js";
|
|
9
|
+
import { PARALL_WIKI_SKILL } from "./parall-wiki.js";
|
|
10
|
+
import { PARALL_SCHEDULES_SKILL } from "./parall-schedules.js";
|
|
11
|
+
export const SKILLS = [
|
|
12
|
+
{
|
|
13
|
+
name: "parall-platform",
|
|
14
|
+
description: "Parall platform queries and lightweight agent provisioning: list org members, agents, chats, read message history, check identity, or create another agent. Use when: user asks about org members, who's online, chat history, agent list, creating an agent, or identity/auth questions.",
|
|
15
|
+
content: PARALL_PLATFORM_SKILL,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "parall-tasks",
|
|
19
|
+
description: "Parall task operations: create, update, comment on, and query tasks and projects. Use when: user asks to create a task, update task status, add comments, list tasks, or manage projects.",
|
|
20
|
+
content: PARALL_TASKS_SKILL,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "parall-wiki",
|
|
24
|
+
description: "Parall wiki operations: read, search, edit, and propose changes to organization knowledge bases. Use when: user asks to read/write docs, edit wiki pages, search knowledge base, propose changes, or review changesets.",
|
|
25
|
+
content: PARALL_WIKI_SKILL,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "parall-schedules",
|
|
29
|
+
description: "Parall schedule operations: create / pause / resume / cancel recurring or one-shot time triggers; respond to schedule fire events. Use when: user asks to set up a recurring reminder, schedule a delayed prompt, run cron-like work, or when the agent receives an `[Event: schedule.fired]` dispatch.",
|
|
30
|
+
content: PARALL_SCHEDULES_SKILL,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
/** Write plain skill markdown files to a target directory (CC/Codex). */
|
|
34
|
+
export function writeSkillFiles(targetDir) {
|
|
35
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
36
|
+
for (const skill of SKILLS) {
|
|
37
|
+
fs.writeFileSync(path.join(targetDir, `${skill.name}.md`), skill.content, "utf8");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function buildSkillReferences(workspaceDir) {
|
|
41
|
+
const dir = path.join(workspaceDir, ".parall", "skills");
|
|
42
|
+
const lines = SKILLS.map((s) => `- ${s.description.split(":")[0]}: \`${dir}/${s.name}.md\``);
|
|
43
|
+
return `## Platform Skills (read on demand)\n\n${lines.join("\n")}\n`;
|
|
44
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const PARALL_PLATFORM_SKILL = "# Parall Platform\n\nQuery organization data via the Parall CLI. Auth is pre-configured.\n\n## Identity\n\n```bash\nparall whoami\n```\n\n## Members & Agents\n\n```bash\nparall members list # All org members (humans + agents)\nparall agents list # Agents only\nparall users get prll://usr_xxx # Get user details by ID\n```\n\nCreate a hosted agent when the user asks for a Parall-managed runtime. Hosted\nprovisioning is asynchronous: creation means the agent identity, API key, and\nmachine record were accepted, not that the runtime is online yet. Use `--wait`\nto wait until the machine reaches `running`, and use `--wait-online` when the\ntask requires the child agent to be connected before you report completion.\nFor hosted agents, use `--discard-api-key`; the server injects the one-time key\ninto the hosted runtime, so the parent agent must not print or persist it.\n\nCreate a self-hosted agent only when the runtime will be connected outside\nParall-managed compute. In that case, write the one-time `api_key` to\n`--api-key-file` so it is not captured in tool-result logs. Treat `api_key` as a\nsecret: do not print, read aloud, post it in shared chats, or echo the file\ncontents. Include the `user.id` in normal responses, and pass the key file only\nthrough an explicit secure runtime handoff when connection is required. Never\nuse `--show-api-key` from an agent runtime. Agent callers cannot set provider\noverrides until the dedicated fine-grained permission flow lands.\n\n```bash\n# Hosted runtime (Parall-managed compute)\nparall agents create \\\n --name \"Research Agent\" \\\n --runtime-type codex \\\n --machine-type cloud \\\n --machine-label standard \\\n --discard-api-key \\\n --wait \\\n --wait-online\n\n# Self-hosted runtime\nparall agents create --name \"Research Agent\" --runtime-type codex --api-key-file /tmp/research-agent.api-key\n```\n\nInspect hosted provisioning directly when a create command returns before the\nruntime is online, or when you need logs for a failed machine. If `agents create`\nexits non-zero after creating a hosted agent, read the printed `user.id` and\n`machine.id`, then use these commands to decide whether to wait, inspect logs,\nor report the failed machine for retry.\n\n```bash\nparall machines status prll://mch_xxx\nparall machines logs prll://mch_xxx --lines 100\n```\n\n## Chats & Messages\n\n```bash\nparall chats list # List all chats\nparall messages list prll://cht_xxx # Read chat message history\n```\n\n## Sending Messages\n\nEach `[Event: message.new]` includes `[Chat: ... (prll://cht_xxx)]` \u2014 use that chat URI to reply.\n\n```bash\n# Reply to a chat (use the chat URI from the event)\nparall messages send prll://cht_xxx --text \"Your reply\"\n\n# Direct message by user URI or display name\nparall dm prll://usr_xxx --text \"Hello\"\nparall dm \"Alice\" --text \"Hello\"\n\n# Thread reply\nparall messages send prll://cht_xxx --text \"Reply\" --thread-root-id 01JWC...\n\n# FYI message (no response expected \u2014 the recipient sees `[Hint: no_reply]`)\nparall messages send prll://cht_xxx --text \"FYI: done\" --no-reply\n\n# Silence this turn entirely \u2014 no chat message produced. Use when you receive\n# `[Hint: no_reply]` or otherwise decide the turn needs no visible reply.\n# Run BEFORE any `messages send` / `dm`; those still deliver real messages.\nparall no-reply --reason \"ack only, nothing to add\"\n```\n\n## Files & Attachments\n\nAttachments appear in events as `[Attachment: prll://att_xxx | mime | size | name]`.\n\n```bash\n# Download an attachment\nparall files download att_xxx --output /tmp/file.png\n\n# Upload a file (returns attachment_id)\nparall files upload /tmp/report.pdf\n\n# Send a message with a file\nparall messages send prll://cht_xxx --file /tmp/output.png --text \"Done\"\n\n# Send an existing attachment to another chat\nparall messages send prll://cht_xxx --attachment att_xxx --text \"See attached\"\n\n# DM with a file\nparall dm \"Alice\" --file /tmp/report.pdf --text \"Report attached\"\n```\n\n`--file` and `--attachment` are mutually exclusive. `--text` can be combined with either.\n\n## Approvals\n\nWhen a CLI command returns a `PERMISSION_DENIED` error, the output includes a `Tip:` line with an approval-request template \u2014 copy it and fill in the remaining placeholders (`--chat`, `--title`, `--reason`). The `Tip:` only appears for commonly approvable actions (archive, delete, restore); for other actions, use `parall approvals actions` to check if it's approvable.\n\n```bash\n# Request approval (use action and resource_uri from the error)\nparall approvals request --action chat.archive --resource prll://cht_xxx --chat prll://cht_yyy --title \"Archive old channel\" --reason \"No activity in 6 months\"\n\n# Check a specific approval's status\nparall approvals get prll://apr_xxx\n\n# Wait for a decision (blocks until approved/rejected/timeout)\nparall approvals wait prll://apr_xxx --timeout 300\n\n# List all your pending approvals\nparall approvals list\n\n# List available approvable actions\nparall approvals actions\n\n# Cancel a pending request you made\nparall approvals cancel prll://apr_xxx\n```\n\nOnly request approval after receiving an actual `PERMISSION_DENIED` error \u2014 never preemptively. The `--chat` flag specifies where the approval card appears; use the chat where the conversation is happening.\n\n## Reference URIs\n\nEvery entity is addressable with a `prll://` URI. Common prefixes you'll see in events, messages, and schedule descriptions:\n\n| Prefix | Entity | Skill |\n|--------|--------|-------|\n| `prll://usr_` | User (human or agent) | parall-platform |\n| `prll://cht_` | Chat | parall-platform |\n| `prll://msg_` | Message | parall-platform |\n| `prll://tsk_` | Task | parall-tasks |\n| `prll://prj_` | Project | parall-tasks |\n| `prll://sch_` | Schedule (time trigger) | parall-schedules |\n| `prll://srn_` | Schedule run (single fire audit record; carries fire-time snapshot) | parall-schedules |\n| `prll://wik_` | Wiki | parall-wiki |\n| `prll://att_` | Attachment | parall-platform (files) |\n\nWhen a message or event references `prll://sch_xxx` or `prll://srn_xxx`, or when you receive `[Event: schedule.fired]`, switch to the **parall-schedules** skill for the CLI commands (create / list / pause / resume / cancel / runs).\n\nAll CLI output is JSON.\n";
|
|
2
|
+
//# sourceMappingURL=parall-platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parall-platform.d.ts","sourceRoot":"","sources":["../../src/skills/parall-platform.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,swMAgKjC,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export const PARALL_PLATFORM_SKILL = `# Parall Platform
|
|
2
|
+
|
|
3
|
+
Query organization data via the Parall CLI. Auth is pre-configured.
|
|
4
|
+
|
|
5
|
+
## Identity
|
|
6
|
+
|
|
7
|
+
\`\`\`bash
|
|
8
|
+
parall whoami
|
|
9
|
+
\`\`\`
|
|
10
|
+
|
|
11
|
+
## Members & Agents
|
|
12
|
+
|
|
13
|
+
\`\`\`bash
|
|
14
|
+
parall members list # All org members (humans + agents)
|
|
15
|
+
parall agents list # Agents only
|
|
16
|
+
parall users get prll://usr_xxx # Get user details by ID
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
Create a hosted agent when the user asks for a Parall-managed runtime. Hosted
|
|
20
|
+
provisioning is asynchronous: creation means the agent identity, API key, and
|
|
21
|
+
machine record were accepted, not that the runtime is online yet. Use \`--wait\`
|
|
22
|
+
to wait until the machine reaches \`running\`, and use \`--wait-online\` when the
|
|
23
|
+
task requires the child agent to be connected before you report completion.
|
|
24
|
+
For hosted agents, use \`--discard-api-key\`; the server injects the one-time key
|
|
25
|
+
into the hosted runtime, so the parent agent must not print or persist it.
|
|
26
|
+
|
|
27
|
+
Create a self-hosted agent only when the runtime will be connected outside
|
|
28
|
+
Parall-managed compute. In that case, write the one-time \`api_key\` to
|
|
29
|
+
\`--api-key-file\` so it is not captured in tool-result logs. Treat \`api_key\` as a
|
|
30
|
+
secret: do not print, read aloud, post it in shared chats, or echo the file
|
|
31
|
+
contents. Include the \`user.id\` in normal responses, and pass the key file only
|
|
32
|
+
through an explicit secure runtime handoff when connection is required. Never
|
|
33
|
+
use \`--show-api-key\` from an agent runtime. Agent callers cannot set provider
|
|
34
|
+
overrides until the dedicated fine-grained permission flow lands.
|
|
35
|
+
|
|
36
|
+
\`\`\`bash
|
|
37
|
+
# Hosted runtime (Parall-managed compute)
|
|
38
|
+
parall agents create \\
|
|
39
|
+
--name "Research Agent" \\
|
|
40
|
+
--runtime-type codex \\
|
|
41
|
+
--machine-type cloud \\
|
|
42
|
+
--machine-label standard \\
|
|
43
|
+
--discard-api-key \\
|
|
44
|
+
--wait \\
|
|
45
|
+
--wait-online
|
|
46
|
+
|
|
47
|
+
# Self-hosted runtime
|
|
48
|
+
parall agents create --name "Research Agent" --runtime-type codex --api-key-file /tmp/research-agent.api-key
|
|
49
|
+
\`\`\`
|
|
50
|
+
|
|
51
|
+
Inspect hosted provisioning directly when a create command returns before the
|
|
52
|
+
runtime is online, or when you need logs for a failed machine. If \`agents create\`
|
|
53
|
+
exits non-zero after creating a hosted agent, read the printed \`user.id\` and
|
|
54
|
+
\`machine.id\`, then use these commands to decide whether to wait, inspect logs,
|
|
55
|
+
or report the failed machine for retry.
|
|
56
|
+
|
|
57
|
+
\`\`\`bash
|
|
58
|
+
parall machines status prll://mch_xxx
|
|
59
|
+
parall machines logs prll://mch_xxx --lines 100
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
## Chats & Messages
|
|
63
|
+
|
|
64
|
+
\`\`\`bash
|
|
65
|
+
parall chats list # List all chats
|
|
66
|
+
parall messages list prll://cht_xxx # Read chat message history
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
## Sending Messages
|
|
70
|
+
|
|
71
|
+
Each \`[Event: message.new]\` includes \`[Chat: ... (prll://cht_xxx)]\` — use that chat URI to reply.
|
|
72
|
+
|
|
73
|
+
\`\`\`bash
|
|
74
|
+
# Reply to a chat (use the chat URI from the event)
|
|
75
|
+
parall messages send prll://cht_xxx --text "Your reply"
|
|
76
|
+
|
|
77
|
+
# Direct message by user URI or display name
|
|
78
|
+
parall dm prll://usr_xxx --text "Hello"
|
|
79
|
+
parall dm "Alice" --text "Hello"
|
|
80
|
+
|
|
81
|
+
# Thread reply
|
|
82
|
+
parall messages send prll://cht_xxx --text "Reply" --thread-root-id 01JWC...
|
|
83
|
+
|
|
84
|
+
# FYI message (no response expected — the recipient sees \`[Hint: no_reply]\`)
|
|
85
|
+
parall messages send prll://cht_xxx --text "FYI: done" --no-reply
|
|
86
|
+
|
|
87
|
+
# Silence this turn entirely — no chat message produced. Use when you receive
|
|
88
|
+
# \`[Hint: no_reply]\` or otherwise decide the turn needs no visible reply.
|
|
89
|
+
# Run BEFORE any \`messages send\` / \`dm\`; those still deliver real messages.
|
|
90
|
+
parall no-reply --reason "ack only, nothing to add"
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
## Files & Attachments
|
|
94
|
+
|
|
95
|
+
Attachments appear in events as \`[Attachment: prll://att_xxx | mime | size | name]\`.
|
|
96
|
+
|
|
97
|
+
\`\`\`bash
|
|
98
|
+
# Download an attachment
|
|
99
|
+
parall files download att_xxx --output /tmp/file.png
|
|
100
|
+
|
|
101
|
+
# Upload a file (returns attachment_id)
|
|
102
|
+
parall files upload /tmp/report.pdf
|
|
103
|
+
|
|
104
|
+
# Send a message with a file
|
|
105
|
+
parall messages send prll://cht_xxx --file /tmp/output.png --text "Done"
|
|
106
|
+
|
|
107
|
+
# Send an existing attachment to another chat
|
|
108
|
+
parall messages send prll://cht_xxx --attachment att_xxx --text "See attached"
|
|
109
|
+
|
|
110
|
+
# DM with a file
|
|
111
|
+
parall dm "Alice" --file /tmp/report.pdf --text "Report attached"
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
\`--file\` and \`--attachment\` are mutually exclusive. \`--text\` can be combined with either.
|
|
115
|
+
|
|
116
|
+
## Approvals
|
|
117
|
+
|
|
118
|
+
When a CLI command returns a \`PERMISSION_DENIED\` error, the output includes a \`Tip:\` line with an approval-request template — copy it and fill in the remaining placeholders (\`--chat\`, \`--title\`, \`--reason\`). The \`Tip:\` only appears for commonly approvable actions (archive, delete, restore); for other actions, use \`parall approvals actions\` to check if it's approvable.
|
|
119
|
+
|
|
120
|
+
\`\`\`bash
|
|
121
|
+
# Request approval (use action and resource_uri from the error)
|
|
122
|
+
parall approvals request --action chat.archive --resource prll://cht_xxx --chat prll://cht_yyy --title "Archive old channel" --reason "No activity in 6 months"
|
|
123
|
+
|
|
124
|
+
# Check a specific approval's status
|
|
125
|
+
parall approvals get prll://apr_xxx
|
|
126
|
+
|
|
127
|
+
# Wait for a decision (blocks until approved/rejected/timeout)
|
|
128
|
+
parall approvals wait prll://apr_xxx --timeout 300
|
|
129
|
+
|
|
130
|
+
# List all your pending approvals
|
|
131
|
+
parall approvals list
|
|
132
|
+
|
|
133
|
+
# List available approvable actions
|
|
134
|
+
parall approvals actions
|
|
135
|
+
|
|
136
|
+
# Cancel a pending request you made
|
|
137
|
+
parall approvals cancel prll://apr_xxx
|
|
138
|
+
\`\`\`
|
|
139
|
+
|
|
140
|
+
Only request approval after receiving an actual \`PERMISSION_DENIED\` error — never preemptively. The \`--chat\` flag specifies where the approval card appears; use the chat where the conversation is happening.
|
|
141
|
+
|
|
142
|
+
## Reference URIs
|
|
143
|
+
|
|
144
|
+
Every entity is addressable with a \`prll://\` URI. Common prefixes you'll see in events, messages, and schedule descriptions:
|
|
145
|
+
|
|
146
|
+
| Prefix | Entity | Skill |
|
|
147
|
+
|--------|--------|-------|
|
|
148
|
+
| \`prll://usr_\` | User (human or agent) | parall-platform |
|
|
149
|
+
| \`prll://cht_\` | Chat | parall-platform |
|
|
150
|
+
| \`prll://msg_\` | Message | parall-platform |
|
|
151
|
+
| \`prll://tsk_\` | Task | parall-tasks |
|
|
152
|
+
| \`prll://prj_\` | Project | parall-tasks |
|
|
153
|
+
| \`prll://sch_\` | Schedule (time trigger) | parall-schedules |
|
|
154
|
+
| \`prll://srn_\` | Schedule run (single fire audit record; carries fire-time snapshot) | parall-schedules |
|
|
155
|
+
| \`prll://wik_\` | Wiki | parall-wiki |
|
|
156
|
+
| \`prll://att_\` | Attachment | parall-platform (files) |
|
|
157
|
+
|
|
158
|
+
When a message or event references \`prll://sch_xxx\` or \`prll://srn_xxx\`, or when you receive \`[Event: schedule.fired]\`, switch to the **parall-schedules** skill for the CLI commands (create / list / pause / resume / cancel / runs).
|
|
159
|
+
|
|
160
|
+
All CLI output is JSON.
|
|
161
|
+
`;
|