@parall/parall 1.21.0 → 1.23.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/package.json +3 -3
- package/skills/parall-wiki/SKILL.md +3 -1
- package/src/gateway.ts +2 -0
- package/src/hooks.ts +7 -3
- package/src/runtime.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/parall",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "OpenClaw channel plugin for Parall IM",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"openclaw.plugin.json"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@parall/
|
|
19
|
-
"@parall/
|
|
18
|
+
"@parall/sdk": "1.23.0",
|
|
19
|
+
"@parall/agent-core": "1.23.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^22.0.0",
|
|
@@ -64,7 +64,9 @@ Always review before proposing.
|
|
|
64
64
|
npx @parall/cli@latest wiki changeset create <slug> --title "Description of changes"
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
This uploads your local changes
|
|
67
|
+
This uploads your local changes. Unprotected paths auto-merge immediately; the
|
|
68
|
+
CLI prints `auto_merged: true` and refreshes the local manifest. Protected
|
|
69
|
+
paths remain as a changeset for review; follow the returned `next_action`.
|
|
68
70
|
|
|
69
71
|
## Changeset Management
|
|
70
72
|
|
package/src/gateway.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { resolveParallAccount } from "./accounts.js";
|
|
|
19
19
|
import {
|
|
20
20
|
getParallRuntime,
|
|
21
21
|
removeParallAccountState,
|
|
22
|
+
setAgentIdentity,
|
|
22
23
|
setDispatchGroupKey,
|
|
23
24
|
setParallAccountState,
|
|
24
25
|
} from "./runtime.js";
|
|
@@ -237,6 +238,7 @@ export const parallGateway: ChannelGatewayAdapter<ResolvedParallAccount> = {
|
|
|
237
238
|
|
|
238
239
|
const me = await client.getMe();
|
|
239
240
|
const agentUserId = me.id;
|
|
241
|
+
setAgentIdentity({ userId: agentUserId, displayName: me.display_name });
|
|
240
242
|
log?.info(`parall[${ctx.accountId}]: authenticated as ${me.display_name} (${agentUserId})`);
|
|
241
243
|
|
|
242
244
|
const stateDir = process.env.OPENCLAW_STATE_DIR
|
package/src/hooks.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
2
|
-
import { PRLL_BEHAVIOR,
|
|
2
|
+
import { PRLL_BEHAVIOR, PRLL_REFERENCE_GUIDE, buildIdentity } from "@parall/agent-core";
|
|
3
3
|
import { extractAccountIdFromSessionKey } from "./session.js";
|
|
4
|
-
import { clearDispatchGroupKey, getDispatchGroupKey, getDispatchMessageId, getParallAccountState, getSessionChatId } from "./runtime.js";
|
|
4
|
+
import { clearDispatchGroupKey, getAgentIdentity, getDispatchGroupKey, getDispatchMessageId, getParallAccountState, getSessionChatId } from "./runtime.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Map the session's stored target ID (whatever the current dispatch routed
|
|
@@ -66,9 +66,13 @@ export function registerParallHooks(api: OpenClawPluginApi) {
|
|
|
66
66
|
// AFTER workspace files so it takes precedence. Order matters: identity anchors
|
|
67
67
|
// who the agent is, channel context is a hard interface constraint, behavior
|
|
68
68
|
// sets working principles, reference guide is the URI lookup reference.
|
|
69
|
+
// Identity is resolved lazily from runtime state — not available at plugin
|
|
70
|
+
// registration time, only after the gateway authenticates via getMe().
|
|
71
|
+
// Uses process-global identity because hosted agents run one-agent-per-pod;
|
|
72
|
+
// before_prompt_build doesn't receive session context anyway.
|
|
69
73
|
api.on("before_prompt_build", () => {
|
|
70
74
|
return {
|
|
71
|
-
appendSystemContext: [
|
|
75
|
+
appendSystemContext: [buildIdentity(getAgentIdentity()), PRLL_CHANNEL_CONTEXT, PRLL_BEHAVIOR, PRLL_REFERENCE_GUIDE].join("\n\n"),
|
|
72
76
|
};
|
|
73
77
|
});
|
|
74
78
|
|
package/src/runtime.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginRuntime } from "openclaw/plugin-sdk";
|
|
2
2
|
import type { ParallClient, ParallWs } from "@parall/sdk";
|
|
3
|
+
import type { AgentIdentity } from "@parall/agent-core";
|
|
3
4
|
export type { ForkResult, DispatchState, ParallEvent } from "@parall/agent-core";
|
|
4
5
|
export {
|
|
5
6
|
setSessionChatId,
|
|
@@ -62,3 +63,13 @@ export function getParallAccountState(accountId: string): ParallAccountState | u
|
|
|
62
63
|
export function getAllParallAccountStates(): ReadonlyMap<string, ParallAccountState> {
|
|
63
64
|
return new Map(accountStates);
|
|
64
65
|
}
|
|
66
|
+
|
|
67
|
+
let agentIdentity: AgentIdentity | undefined;
|
|
68
|
+
|
|
69
|
+
export function setAgentIdentity(identity: AgentIdentity) {
|
|
70
|
+
agentIdentity = identity;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getAgentIdentity(): AgentIdentity | undefined {
|
|
74
|
+
return agentIdentity;
|
|
75
|
+
}
|