@parall/daemon 1.49.0 → 1.50.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/bundle/manifest.json +11 -11
- package/bundle/parall-browser-pod.js +318 -104
- package/bundle/parall-claude-agent.js +124 -29
- package/bundle/parall-codex-agent.js +124 -29
- package/bundle/parall-daemon.js +368 -184
- package/dist/browser-pod.d.ts.map +1 -1
- package/dist/browser-pod.js +9 -14
- package/dist/browser-profile-viewer-control.d.ts +15 -0
- package/dist/browser-profile-viewer-control.d.ts.map +1 -0
- package/dist/browser-profile-viewer-control.js +27 -0
- package/dist/clip-runtime/bb-viewer-command-client.d.ts +19 -0
- package/dist/clip-runtime/bb-viewer-command-client.d.ts.map +1 -0
- package/dist/clip-runtime/bb-viewer-command-client.js +89 -0
- package/dist/clip-runtime/browser-profile-manager.d.ts +3 -1
- package/dist/clip-runtime/browser-profile-manager.d.ts.map +1 -1
- package/dist/clip-runtime/browser-profile-manager.js +2 -2
- package/dist/clip-runtime/browser-viewer-streamer.d.ts +7 -7
- package/dist/clip-runtime/browser-viewer-streamer.d.ts.map +1 -1
- package/dist/clip-runtime/browser-viewer-streamer.js +39 -47
- package/dist/clip-runtime/clip-provider.d.ts +3 -2
- package/dist/clip-runtime/clip-provider.d.ts.map +1 -1
- package/dist/clip-runtime/clip-provider.js +13 -6
- package/dist/clip-runtime/hosted-viewer-command-queue.d.ts +43 -0
- package/dist/clip-runtime/hosted-viewer-command-queue.d.ts.map +1 -0
- package/dist/clip-runtime/hosted-viewer-command-queue.js +72 -0
- package/dist/clip-runtime/index.d.ts +1 -0
- package/dist/clip-runtime/index.d.ts.map +1 -1
- package/dist/clip-runtime/index.js +1 -0
- package/dist/clip-runtime/viewer-command-deadline.d.ts +14 -0
- package/dist/clip-runtime/viewer-command-deadline.d.ts.map +1 -0
- package/dist/clip-runtime/viewer-command-deadline.js +29 -0
- package/dist/clip-runtime/viewer-command-error.d.ts +18 -0
- package/dist/clip-runtime/viewer-command-error.d.ts.map +1 -0
- package/dist/clip-runtime/viewer-command-error.js +23 -0
- package/dist/supervisor.d.ts +0 -8
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/supervisor.js +3 -32
- package/package.json +6 -6
|
@@ -51291,8 +51291,16 @@ function laneContextFilePath(contextDir, targetUri, threadRootId) {
|
|
|
51291
51291
|
return path.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
|
|
51292
51292
|
}
|
|
51293
51293
|
|
|
51294
|
-
// ts/sdk/dist/
|
|
51295
|
-
var
|
|
51294
|
+
// ts/sdk/dist/browser-viewer.js
|
|
51295
|
+
var BROWSER_VIEWER_READINESS_TIMEOUT_MS = 6e4;
|
|
51296
|
+
function browserViewerRequestOptions(command, opts) {
|
|
51297
|
+
if (command !== "stream.answer" && command !== "stream.switch")
|
|
51298
|
+
return opts;
|
|
51299
|
+
return {
|
|
51300
|
+
...opts,
|
|
51301
|
+
timeoutMs: Math.max(opts?.timeoutMs ?? 0, BROWSER_VIEWER_READINESS_TIMEOUT_MS)
|
|
51302
|
+
};
|
|
51303
|
+
}
|
|
51296
51304
|
|
|
51297
51305
|
// ts/sdk/dist/constants.js
|
|
51298
51306
|
var API_BASE = "/api/v1";
|
|
@@ -51328,6 +51336,12 @@ var ENDPOINTS = {
|
|
|
51328
51336
|
ORG_MEMBER: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
|
|
51329
51337
|
ORG_MEMBER_CHATS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
|
|
51330
51338
|
ORG_MEMBER_TASKS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
|
|
51339
|
+
// Org-scoped public profile (title / description). GET readable by every
|
|
51340
|
+
// active member; PATCH is CAS-guarded (expected_version).
|
|
51341
|
+
ORG_MEMBER_PROFILE: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}/profile`,
|
|
51342
|
+
// Private agent Instructions — visibility gated server-side
|
|
51343
|
+
// (agent self + Human org admin/owner). Never cached.
|
|
51344
|
+
AGENT_INSTRUCTIONS: (orgId, agentId) => `${API_BASE}/orgs/${orgId}/agents/${agentId}/instructions`,
|
|
51331
51345
|
REF_SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/refs/search`,
|
|
51332
51346
|
// Direct messages (org-scoped, atomic find-or-create + send)
|
|
51333
51347
|
DM: (orgId) => `${API_BASE}/orgs/${orgId}/dm`,
|
|
@@ -51611,6 +51625,11 @@ var ENDPOINTS = {
|
|
|
51611
51625
|
SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/search`,
|
|
51612
51626
|
// Feature flags (org-scoped, server-evaluated)
|
|
51613
51627
|
FEATURE_FLAGS: (orgId) => `${API_BASE}/orgs/${orgId}/feature-flags`,
|
|
51628
|
+
// Team templates (org-scoped, owner/admin only)
|
|
51629
|
+
TEMPLATES: (orgId) => `${API_BASE}/orgs/${orgId}/templates`,
|
|
51630
|
+
TEMPLATE: (orgId, templateId) => `${API_BASE}/orgs/${orgId}/templates/${templateId}`,
|
|
51631
|
+
TEMPLATE_DEPLOYMENTS: (orgId) => `${API_BASE}/orgs/${orgId}/template-deployments`,
|
|
51632
|
+
TEMPLATE_DEPLOYMENT: (orgId, deploymentId) => `${API_BASE}/orgs/${orgId}/template-deployments/${deploymentId}`,
|
|
51614
51633
|
// Billing & Credits (org-scoped)
|
|
51615
51634
|
BILLING: (orgId) => `${API_BASE}/orgs/${orgId}/billing`,
|
|
51616
51635
|
BILLING_TRANSACTIONS: (orgId) => `${API_BASE}/orgs/${orgId}/billing/transactions`,
|
|
@@ -52131,6 +52150,30 @@ var ParallClient = class _ParallClient {
|
|
|
52131
52150
|
async updateOrgMember(orgId, userId, role) {
|
|
52132
52151
|
return this.request("PATCH", ENDPOINTS.ORG_MEMBER(orgId, userId), { role });
|
|
52133
52152
|
}
|
|
52153
|
+
/** Org-scoped public profile (title / description) of any active member. */
|
|
52154
|
+
async getMemberProfile(orgId, userId) {
|
|
52155
|
+
return this.request("GET", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId));
|
|
52156
|
+
}
|
|
52157
|
+
/**
|
|
52158
|
+
* CAS full-replacement of a member's public profile. Humans edit their
|
|
52159
|
+
* own; Human org admins/owners edit agents'. A stale expected_version
|
|
52160
|
+
* gets 409 PROFILE_VERSION_CONFLICT with error.details.current_version.
|
|
52161
|
+
*/
|
|
52162
|
+
async updateMemberProfile(orgId, userId, req) {
|
|
52163
|
+
return this.request("PATCH", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId), req);
|
|
52164
|
+
}
|
|
52165
|
+
/** Private agent Instructions — agent self or Human org admin/owner only. */
|
|
52166
|
+
async getAgentInstructions(orgId, agentId) {
|
|
52167
|
+
return this.request("GET", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId));
|
|
52168
|
+
}
|
|
52169
|
+
/**
|
|
52170
|
+
* CAS update of the private Instructions (Human org admin/owner only).
|
|
52171
|
+
* A stale expected_version gets 409 INSTRUCTIONS_VERSION_CONFLICT with
|
|
52172
|
+
* error.details.current_version.
|
|
52173
|
+
*/
|
|
52174
|
+
async updateAgentInstructions(orgId, agentId, req) {
|
|
52175
|
+
return this.request("PATCH", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId), req);
|
|
52176
|
+
}
|
|
52134
52177
|
// Member activity surfaces — chats the member participates in within this org,
|
|
52135
52178
|
// ordered by most recent activity. Powers the member profile Activity tab.
|
|
52136
52179
|
async getMemberChats(orgId, memberId, params) {
|
|
@@ -52688,11 +52731,7 @@ var ParallClient = class _ParallClient {
|
|
|
52688
52731
|
async postBrowseResponse(requestId, response) {
|
|
52689
52732
|
return this.request("POST", ENDPOINTS.MACHINES_ME_BROWSE_RESPONSE(requestId), response);
|
|
52690
52733
|
}
|
|
52691
|
-
/**
|
|
52692
|
-
* `POST /machines/me/browser-profiles/viewer-response/{requestId}` — daemon
|
|
52693
|
-
* reply to a `machine.browser_profile.viewer` control command. Wakes the
|
|
52694
|
-
* api-server request/reply bridge (mirrors {@link postBrowseResponse}).
|
|
52695
|
-
*/
|
|
52734
|
+
/** Reply to `machine.browser_profile.viewer` and wake its request/reply bridge. */
|
|
52696
52735
|
async postBrowserProfileViewerResponse(requestId, response) {
|
|
52697
52736
|
return this.request("POST", ENDPOINTS.MACHINES_ME_BROWSER_PROFILE_VIEWER_RESPONSE(requestId), response);
|
|
52698
52737
|
}
|
|
@@ -52702,7 +52741,7 @@ var ParallClient = class _ParallClient {
|
|
|
52702
52741
|
* owner or org admin. api-server brokers the command to the host daemon.
|
|
52703
52742
|
*/
|
|
52704
52743
|
async browserViewerCommand(orgId, profileId, req, opts) {
|
|
52705
|
-
return this.request("POST", ENDPOINTS.BROWSER_PROFILE_VIEWER_COMMAND(orgId, profileId), req, void 0, false, opts);
|
|
52744
|
+
return this.request("POST", ENDPOINTS.BROWSER_PROFILE_VIEWER_COMMAND(orgId, profileId), req, void 0, false, browserViewerRequestOptions(req.command, opts));
|
|
52706
52745
|
}
|
|
52707
52746
|
/**
|
|
52708
52747
|
* Drive the Cloud Edge live viewer (V1b, design §6): WebRTC signaling + input +
|
|
@@ -53474,6 +53513,22 @@ var ParallClient = class _ParallClient {
|
|
|
53474
53513
|
async getFeatureFlags(orgId) {
|
|
53475
53514
|
return this.request("GET", ENDPOINTS.FEATURE_FLAGS(orgId));
|
|
53476
53515
|
}
|
|
53516
|
+
// ---- Official Template catalog (org-contextual owner/admin reads + Hire) ----
|
|
53517
|
+
async listOfficialTemplates(orgId) {
|
|
53518
|
+
const response = await this.request("GET", ENDPOINTS.TEMPLATES(orgId));
|
|
53519
|
+
return response.templates ?? [];
|
|
53520
|
+
}
|
|
53521
|
+
async getOfficialTemplate(orgId, templateId) {
|
|
53522
|
+
return this.request("GET", ENDPOINTS.TEMPLATE(orgId, templateId));
|
|
53523
|
+
}
|
|
53524
|
+
async deployTemplate(orgId, request3) {
|
|
53525
|
+
return this.request("POST", ENDPOINTS.TEMPLATE_DEPLOYMENTS(orgId), request3, void 0, false, {
|
|
53526
|
+
timeoutMs: 185e3
|
|
53527
|
+
});
|
|
53528
|
+
}
|
|
53529
|
+
async getTemplateDeployment(orgId, deploymentId) {
|
|
53530
|
+
return this.request("GET", ENDPOINTS.TEMPLATE_DEPLOYMENT(orgId, deploymentId));
|
|
53531
|
+
}
|
|
53477
53532
|
// ---- Billing & Credits (org-scoped) ----
|
|
53478
53533
|
async getBilling(orgId) {
|
|
53479
53534
|
return this.request("GET", ENDPOINTS.BILLING(orgId));
|
|
@@ -53870,6 +53925,20 @@ function buildApiError(res, rawErrorBody) {
|
|
|
53870
53925
|
return apiError;
|
|
53871
53926
|
}
|
|
53872
53927
|
|
|
53928
|
+
// ts/sdk/dist/types.js
|
|
53929
|
+
var MENTION_ALL_USER_ID = "all";
|
|
53930
|
+
var MENTION_ALL_HUMANS_USER_ID = "allhuman";
|
|
53931
|
+
var MENTION_ALL_AGENTS_USER_ID = "allagent";
|
|
53932
|
+
function mentionTargetsUser(mentionUserId, userId, userType) {
|
|
53933
|
+
if (mentionUserId === userId || mentionUserId === MENTION_ALL_USER_ID)
|
|
53934
|
+
return true;
|
|
53935
|
+
if (mentionUserId === MENTION_ALL_HUMANS_USER_ID)
|
|
53936
|
+
return userType === "human";
|
|
53937
|
+
if (mentionUserId === MENTION_ALL_AGENTS_USER_ID)
|
|
53938
|
+
return userType === "agent";
|
|
53939
|
+
return false;
|
|
53940
|
+
}
|
|
53941
|
+
|
|
53873
53942
|
// ts/sdk/dist/ws.js
|
|
53874
53943
|
function isRetryableNetworkError(err) {
|
|
53875
53944
|
return err instanceof Error && err.name === "ApiError" && "status" in err && err.status === 0;
|
|
@@ -55128,6 +55197,17 @@ function buildForkResultPrefix(results) {
|
|
|
55128
55197
|
}
|
|
55129
55198
|
|
|
55130
55199
|
// ts/agent-core/dist/prompt-fragments.js
|
|
55200
|
+
function identityFromMe(me) {
|
|
55201
|
+
return {
|
|
55202
|
+
userId: me.id,
|
|
55203
|
+
displayName: me.display_name,
|
|
55204
|
+
title: me.public_profile?.title || void 0,
|
|
55205
|
+
publicDescription: me.public_profile?.description || void 0,
|
|
55206
|
+
// `||` on purpose: an empty-string instructions must also fall back to
|
|
55207
|
+
// the deprecated description alias (empty means "unset" on this wire).
|
|
55208
|
+
instructions: me.agent_profile?.instructions || me.agent_profile?.description || void 0
|
|
55209
|
+
};
|
|
55210
|
+
}
|
|
55131
55211
|
var PRLL_IDENTITY_BASE = `## You on Parall
|
|
55132
55212
|
|
|
55133
55213
|
Parall is a shared workspace where humans and agents work side by side as equals.
|
|
@@ -55149,11 +55229,15 @@ function buildIdentity(agent) {
|
|
|
55149
55229
|
const name = sanitizeProfileField(agent.displayName);
|
|
55150
55230
|
const lines = [PRLL_IDENTITY_BASE, "", "### Your Parall Identity", ""];
|
|
55151
55231
|
lines.push(`You are **${name}** (\`prll://${agent.userId}\`).`);
|
|
55152
|
-
|
|
55153
|
-
|
|
55154
|
-
|
|
55155
|
-
|
|
55156
|
-
|
|
55232
|
+
const title = agent.title ? sanitizeProfileField(agent.title) : "";
|
|
55233
|
+
if (title)
|
|
55234
|
+
lines.push(`Title: ${title}`);
|
|
55235
|
+
const about = agent.publicDescription ? sanitizeProfileField(agent.publicDescription) : "";
|
|
55236
|
+
if (about)
|
|
55237
|
+
lines.push(`About: ${about}`);
|
|
55238
|
+
const instructions = sanitizeProfileBlock(agent.instructions ?? agent.description ?? "");
|
|
55239
|
+
if (instructions) {
|
|
55240
|
+
lines.push("", "### Private instructions from your organization admins", "", instructions);
|
|
55157
55241
|
}
|
|
55158
55242
|
lines.push("", `When you see \`${agent.userId}\` or \`prll://${agent.userId}\` in messages, mentions, or events \u2014 that's you.`);
|
|
55159
55243
|
return lines.join("\n");
|
|
@@ -58139,7 +58223,7 @@ var ParallAgentGateway = class {
|
|
|
58139
58223
|
return { action: "skip" };
|
|
58140
58224
|
if (chatInfo.type === "group" && chatInfo.agentRoutingMode !== "active") {
|
|
58141
58225
|
const mentions = content.mentions ?? [];
|
|
58142
|
-
const isMentioned = mentions.some((mention) => mention.user_id
|
|
58226
|
+
const isMentioned = mentions.some((mention) => mentionTargetsUser(mention.user_id, this.opts.agentUserId, "agent"));
|
|
58143
58227
|
if (!isMentioned)
|
|
58144
58228
|
return { action: "skip" };
|
|
58145
58229
|
}
|
|
@@ -59139,8 +59223,17 @@ parall whoami
|
|
|
59139
59223
|
parall members list # All org members (humans + agents)
|
|
59140
59224
|
parall agents list # Agents only
|
|
59141
59225
|
parall users get prll://usr_xxx # Get user details by ID
|
|
59226
|
+
parall members profile prll://usr_xxx # A member's public profile (title / about)
|
|
59227
|
+
parall agents instructions # Your own private Instructions (admin-maintained)
|
|
59142
59228
|
\`\`\`
|
|
59143
59229
|
|
|
59230
|
+
Every member carries an org-scoped public profile: \`title\` (role, e.g.
|
|
59231
|
+
"Platform Lead") and \`description\` (a short about). \`members list\` includes
|
|
59232
|
+
both \u2014 use them to route work to the right person or agent. Your own system
|
|
59233
|
+
prompt already contains your public profile and your private Instructions;
|
|
59234
|
+
you cannot edit either of them \u2014 if yours should change, DM a Human org
|
|
59235
|
+
admin and ask.
|
|
59236
|
+
|
|
59144
59237
|
Create a hosted agent when the user asks for a Parall-managed runtime. Hosted
|
|
59145
59238
|
provisioning is asynchronous: creation means the agent identity, API key, and
|
|
59146
59239
|
machine record were accepted, not that the runtime is online yet. Use \`--wait\`
|
|
@@ -61538,7 +61631,7 @@ async function getAgentMeWithLegacyFallback(client, orgId) {
|
|
|
61538
61631
|
throw err;
|
|
61539
61632
|
}
|
|
61540
61633
|
const user = await client.getMe();
|
|
61541
|
-
return { ...user, agent_profile: null };
|
|
61634
|
+
return { ...user, agent_profile: null, public_profile: null };
|
|
61542
61635
|
}
|
|
61543
61636
|
}
|
|
61544
61637
|
function resolveProviderEnv() {
|
|
@@ -61579,11 +61672,9 @@ async function main() {
|
|
|
61579
61672
|
const agentUserId = me.id;
|
|
61580
61673
|
const agentLog = childLogger(activeLog, agentUserId);
|
|
61581
61674
|
activeLog = agentLog;
|
|
61582
|
-
|
|
61583
|
-
|
|
61584
|
-
|
|
61585
|
-
description: me.agent_profile?.description ?? void 0
|
|
61586
|
-
};
|
|
61675
|
+
let agentIdentity = identityFromMe(me);
|
|
61676
|
+
let lastIdentitySnapshot = JSON.stringify(agentIdentity);
|
|
61677
|
+
let lastKnownAgentProfile = me.agent_profile;
|
|
61587
61678
|
const runtimeKey = config.runtimeKey || buildClaudeRuntimeKey(agentUserId);
|
|
61588
61679
|
const sessionStateFilePath = sessionStateFilePathForRuntime(config.stateDir, runtimeKey);
|
|
61589
61680
|
const sessionManager = new ClaudeSessionManager(runtimeKey, sessionStateFilePath, agentLog);
|
|
@@ -61644,15 +61735,17 @@ async function main() {
|
|
|
61644
61735
|
}
|
|
61645
61736
|
const refreshPlatformConfig = async () => {
|
|
61646
61737
|
const updated = await configMgr.fetch();
|
|
61647
|
-
let
|
|
61648
|
-
|
|
61649
|
-
|
|
61650
|
-
|
|
61651
|
-
|
|
61652
|
-
|
|
61653
|
-
|
|
61738
|
+
let refreshedMe;
|
|
61739
|
+
try {
|
|
61740
|
+
refreshedMe = await getAgentMeWithLegacyFallback(client, config.orgId);
|
|
61741
|
+
} catch (err) {
|
|
61742
|
+
agentLog.warn(`platform config refresh: /agents/me refetch failed (keeping last-known identity): ${String(err)}`);
|
|
61743
|
+
}
|
|
61744
|
+
if (refreshedMe) {
|
|
61745
|
+
agentIdentity = identityFromMe(refreshedMe);
|
|
61746
|
+
lastKnownAgentProfile = refreshedMe.agent_profile;
|
|
61654
61747
|
}
|
|
61655
|
-
const isPin = deriveModelIsPin(updated,
|
|
61748
|
+
const isPin = deriveModelIsPin(updated, lastKnownAgentProfile);
|
|
61656
61749
|
const localEffort = process.env.CLAUDE_CODE_EFFORT_LEVEL?.trim() || null;
|
|
61657
61750
|
adapter.updateConfig({
|
|
61658
61751
|
model: resolveRuntimeModel(isPin, updated.model, config.model) ?? null,
|
|
@@ -61667,8 +61760,10 @@ async function main() {
|
|
|
61667
61760
|
promptWritten = false;
|
|
61668
61761
|
agentLog.warn(`system prompt refresh write failed (retrying next refresh): ${String(err)}`);
|
|
61669
61762
|
}
|
|
61670
|
-
|
|
61763
|
+
const identitySnapshot = JSON.stringify(agentIdentity);
|
|
61764
|
+
if (promptWritten && (joinedFragments !== lastCapabilityFragments || identitySnapshot !== lastIdentitySnapshot)) {
|
|
61671
61765
|
lastCapabilityFragments = joinedFragments;
|
|
61766
|
+
lastIdentitySnapshot = identitySnapshot;
|
|
61672
61767
|
adapter.requestProcessRestart();
|
|
61673
61768
|
}
|
|
61674
61769
|
};
|
|
@@ -51291,8 +51291,16 @@ function laneContextFilePath(contextDir, targetUri, threadRootId) {
|
|
|
51291
51291
|
return path.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
|
|
51292
51292
|
}
|
|
51293
51293
|
|
|
51294
|
-
// ts/sdk/dist/
|
|
51295
|
-
var
|
|
51294
|
+
// ts/sdk/dist/browser-viewer.js
|
|
51295
|
+
var BROWSER_VIEWER_READINESS_TIMEOUT_MS = 6e4;
|
|
51296
|
+
function browserViewerRequestOptions(command, opts) {
|
|
51297
|
+
if (command !== "stream.answer" && command !== "stream.switch")
|
|
51298
|
+
return opts;
|
|
51299
|
+
return {
|
|
51300
|
+
...opts,
|
|
51301
|
+
timeoutMs: Math.max(opts?.timeoutMs ?? 0, BROWSER_VIEWER_READINESS_TIMEOUT_MS)
|
|
51302
|
+
};
|
|
51303
|
+
}
|
|
51296
51304
|
|
|
51297
51305
|
// ts/sdk/dist/constants.js
|
|
51298
51306
|
var API_BASE = "/api/v1";
|
|
@@ -51328,6 +51336,12 @@ var ENDPOINTS = {
|
|
|
51328
51336
|
ORG_MEMBER: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
|
|
51329
51337
|
ORG_MEMBER_CHATS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
|
|
51330
51338
|
ORG_MEMBER_TASKS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
|
|
51339
|
+
// Org-scoped public profile (title / description). GET readable by every
|
|
51340
|
+
// active member; PATCH is CAS-guarded (expected_version).
|
|
51341
|
+
ORG_MEMBER_PROFILE: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}/profile`,
|
|
51342
|
+
// Private agent Instructions — visibility gated server-side
|
|
51343
|
+
// (agent self + Human org admin/owner). Never cached.
|
|
51344
|
+
AGENT_INSTRUCTIONS: (orgId, agentId) => `${API_BASE}/orgs/${orgId}/agents/${agentId}/instructions`,
|
|
51331
51345
|
REF_SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/refs/search`,
|
|
51332
51346
|
// Direct messages (org-scoped, atomic find-or-create + send)
|
|
51333
51347
|
DM: (orgId) => `${API_BASE}/orgs/${orgId}/dm`,
|
|
@@ -51611,6 +51625,11 @@ var ENDPOINTS = {
|
|
|
51611
51625
|
SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/search`,
|
|
51612
51626
|
// Feature flags (org-scoped, server-evaluated)
|
|
51613
51627
|
FEATURE_FLAGS: (orgId) => `${API_BASE}/orgs/${orgId}/feature-flags`,
|
|
51628
|
+
// Team templates (org-scoped, owner/admin only)
|
|
51629
|
+
TEMPLATES: (orgId) => `${API_BASE}/orgs/${orgId}/templates`,
|
|
51630
|
+
TEMPLATE: (orgId, templateId) => `${API_BASE}/orgs/${orgId}/templates/${templateId}`,
|
|
51631
|
+
TEMPLATE_DEPLOYMENTS: (orgId) => `${API_BASE}/orgs/${orgId}/template-deployments`,
|
|
51632
|
+
TEMPLATE_DEPLOYMENT: (orgId, deploymentId) => `${API_BASE}/orgs/${orgId}/template-deployments/${deploymentId}`,
|
|
51614
51633
|
// Billing & Credits (org-scoped)
|
|
51615
51634
|
BILLING: (orgId) => `${API_BASE}/orgs/${orgId}/billing`,
|
|
51616
51635
|
BILLING_TRANSACTIONS: (orgId) => `${API_BASE}/orgs/${orgId}/billing/transactions`,
|
|
@@ -52131,6 +52150,30 @@ var ParallClient = class _ParallClient {
|
|
|
52131
52150
|
async updateOrgMember(orgId, userId, role) {
|
|
52132
52151
|
return this.request("PATCH", ENDPOINTS.ORG_MEMBER(orgId, userId), { role });
|
|
52133
52152
|
}
|
|
52153
|
+
/** Org-scoped public profile (title / description) of any active member. */
|
|
52154
|
+
async getMemberProfile(orgId, userId) {
|
|
52155
|
+
return this.request("GET", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId));
|
|
52156
|
+
}
|
|
52157
|
+
/**
|
|
52158
|
+
* CAS full-replacement of a member's public profile. Humans edit their
|
|
52159
|
+
* own; Human org admins/owners edit agents'. A stale expected_version
|
|
52160
|
+
* gets 409 PROFILE_VERSION_CONFLICT with error.details.current_version.
|
|
52161
|
+
*/
|
|
52162
|
+
async updateMemberProfile(orgId, userId, req) {
|
|
52163
|
+
return this.request("PATCH", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId), req);
|
|
52164
|
+
}
|
|
52165
|
+
/** Private agent Instructions — agent self or Human org admin/owner only. */
|
|
52166
|
+
async getAgentInstructions(orgId, agentId) {
|
|
52167
|
+
return this.request("GET", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId));
|
|
52168
|
+
}
|
|
52169
|
+
/**
|
|
52170
|
+
* CAS update of the private Instructions (Human org admin/owner only).
|
|
52171
|
+
* A stale expected_version gets 409 INSTRUCTIONS_VERSION_CONFLICT with
|
|
52172
|
+
* error.details.current_version.
|
|
52173
|
+
*/
|
|
52174
|
+
async updateAgentInstructions(orgId, agentId, req) {
|
|
52175
|
+
return this.request("PATCH", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId), req);
|
|
52176
|
+
}
|
|
52134
52177
|
// Member activity surfaces — chats the member participates in within this org,
|
|
52135
52178
|
// ordered by most recent activity. Powers the member profile Activity tab.
|
|
52136
52179
|
async getMemberChats(orgId, memberId, params) {
|
|
@@ -52688,11 +52731,7 @@ var ParallClient = class _ParallClient {
|
|
|
52688
52731
|
async postBrowseResponse(requestId, response) {
|
|
52689
52732
|
return this.request("POST", ENDPOINTS.MACHINES_ME_BROWSE_RESPONSE(requestId), response);
|
|
52690
52733
|
}
|
|
52691
|
-
/**
|
|
52692
|
-
* `POST /machines/me/browser-profiles/viewer-response/{requestId}` — daemon
|
|
52693
|
-
* reply to a `machine.browser_profile.viewer` control command. Wakes the
|
|
52694
|
-
* api-server request/reply bridge (mirrors {@link postBrowseResponse}).
|
|
52695
|
-
*/
|
|
52734
|
+
/** Reply to `machine.browser_profile.viewer` and wake its request/reply bridge. */
|
|
52696
52735
|
async postBrowserProfileViewerResponse(requestId, response) {
|
|
52697
52736
|
return this.request("POST", ENDPOINTS.MACHINES_ME_BROWSER_PROFILE_VIEWER_RESPONSE(requestId), response);
|
|
52698
52737
|
}
|
|
@@ -52702,7 +52741,7 @@ var ParallClient = class _ParallClient {
|
|
|
52702
52741
|
* owner or org admin. api-server brokers the command to the host daemon.
|
|
52703
52742
|
*/
|
|
52704
52743
|
async browserViewerCommand(orgId, profileId, req, opts) {
|
|
52705
|
-
return this.request("POST", ENDPOINTS.BROWSER_PROFILE_VIEWER_COMMAND(orgId, profileId), req, void 0, false, opts);
|
|
52744
|
+
return this.request("POST", ENDPOINTS.BROWSER_PROFILE_VIEWER_COMMAND(orgId, profileId), req, void 0, false, browserViewerRequestOptions(req.command, opts));
|
|
52706
52745
|
}
|
|
52707
52746
|
/**
|
|
52708
52747
|
* Drive the Cloud Edge live viewer (V1b, design §6): WebRTC signaling + input +
|
|
@@ -53474,6 +53513,22 @@ var ParallClient = class _ParallClient {
|
|
|
53474
53513
|
async getFeatureFlags(orgId) {
|
|
53475
53514
|
return this.request("GET", ENDPOINTS.FEATURE_FLAGS(orgId));
|
|
53476
53515
|
}
|
|
53516
|
+
// ---- Official Template catalog (org-contextual owner/admin reads + Hire) ----
|
|
53517
|
+
async listOfficialTemplates(orgId) {
|
|
53518
|
+
const response = await this.request("GET", ENDPOINTS.TEMPLATES(orgId));
|
|
53519
|
+
return response.templates ?? [];
|
|
53520
|
+
}
|
|
53521
|
+
async getOfficialTemplate(orgId, templateId) {
|
|
53522
|
+
return this.request("GET", ENDPOINTS.TEMPLATE(orgId, templateId));
|
|
53523
|
+
}
|
|
53524
|
+
async deployTemplate(orgId, request3) {
|
|
53525
|
+
return this.request("POST", ENDPOINTS.TEMPLATE_DEPLOYMENTS(orgId), request3, void 0, false, {
|
|
53526
|
+
timeoutMs: 185e3
|
|
53527
|
+
});
|
|
53528
|
+
}
|
|
53529
|
+
async getTemplateDeployment(orgId, deploymentId) {
|
|
53530
|
+
return this.request("GET", ENDPOINTS.TEMPLATE_DEPLOYMENT(orgId, deploymentId));
|
|
53531
|
+
}
|
|
53477
53532
|
// ---- Billing & Credits (org-scoped) ----
|
|
53478
53533
|
async getBilling(orgId) {
|
|
53479
53534
|
return this.request("GET", ENDPOINTS.BILLING(orgId));
|
|
@@ -53870,6 +53925,20 @@ function buildApiError(res, rawErrorBody) {
|
|
|
53870
53925
|
return apiError;
|
|
53871
53926
|
}
|
|
53872
53927
|
|
|
53928
|
+
// ts/sdk/dist/types.js
|
|
53929
|
+
var MENTION_ALL_USER_ID = "all";
|
|
53930
|
+
var MENTION_ALL_HUMANS_USER_ID = "allhuman";
|
|
53931
|
+
var MENTION_ALL_AGENTS_USER_ID = "allagent";
|
|
53932
|
+
function mentionTargetsUser(mentionUserId, userId, userType) {
|
|
53933
|
+
if (mentionUserId === userId || mentionUserId === MENTION_ALL_USER_ID)
|
|
53934
|
+
return true;
|
|
53935
|
+
if (mentionUserId === MENTION_ALL_HUMANS_USER_ID)
|
|
53936
|
+
return userType === "human";
|
|
53937
|
+
if (mentionUserId === MENTION_ALL_AGENTS_USER_ID)
|
|
53938
|
+
return userType === "agent";
|
|
53939
|
+
return false;
|
|
53940
|
+
}
|
|
53941
|
+
|
|
53873
53942
|
// ts/sdk/dist/ws.js
|
|
53874
53943
|
function isRetryableNetworkError(err) {
|
|
53875
53944
|
return err instanceof Error && err.name === "ApiError" && "status" in err && err.status === 0;
|
|
@@ -55128,6 +55197,17 @@ function buildForkResultPrefix(results) {
|
|
|
55128
55197
|
}
|
|
55129
55198
|
|
|
55130
55199
|
// ts/agent-core/dist/prompt-fragments.js
|
|
55200
|
+
function identityFromMe(me) {
|
|
55201
|
+
return {
|
|
55202
|
+
userId: me.id,
|
|
55203
|
+
displayName: me.display_name,
|
|
55204
|
+
title: me.public_profile?.title || void 0,
|
|
55205
|
+
publicDescription: me.public_profile?.description || void 0,
|
|
55206
|
+
// `||` on purpose: an empty-string instructions must also fall back to
|
|
55207
|
+
// the deprecated description alias (empty means "unset" on this wire).
|
|
55208
|
+
instructions: me.agent_profile?.instructions || me.agent_profile?.description || void 0
|
|
55209
|
+
};
|
|
55210
|
+
}
|
|
55131
55211
|
var PRLL_IDENTITY_BASE = `## You on Parall
|
|
55132
55212
|
|
|
55133
55213
|
Parall is a shared workspace where humans and agents work side by side as equals.
|
|
@@ -55149,11 +55229,15 @@ function buildIdentity(agent) {
|
|
|
55149
55229
|
const name = sanitizeProfileField(agent.displayName);
|
|
55150
55230
|
const lines = [PRLL_IDENTITY_BASE, "", "### Your Parall Identity", ""];
|
|
55151
55231
|
lines.push(`You are **${name}** (\`prll://${agent.userId}\`).`);
|
|
55152
|
-
|
|
55153
|
-
|
|
55154
|
-
|
|
55155
|
-
|
|
55156
|
-
|
|
55232
|
+
const title = agent.title ? sanitizeProfileField(agent.title) : "";
|
|
55233
|
+
if (title)
|
|
55234
|
+
lines.push(`Title: ${title}`);
|
|
55235
|
+
const about = agent.publicDescription ? sanitizeProfileField(agent.publicDescription) : "";
|
|
55236
|
+
if (about)
|
|
55237
|
+
lines.push(`About: ${about}`);
|
|
55238
|
+
const instructions = sanitizeProfileBlock(agent.instructions ?? agent.description ?? "");
|
|
55239
|
+
if (instructions) {
|
|
55240
|
+
lines.push("", "### Private instructions from your organization admins", "", instructions);
|
|
55157
55241
|
}
|
|
55158
55242
|
lines.push("", `When you see \`${agent.userId}\` or \`prll://${agent.userId}\` in messages, mentions, or events \u2014 that's you.`);
|
|
55159
55243
|
return lines.join("\n");
|
|
@@ -58139,7 +58223,7 @@ var ParallAgentGateway = class {
|
|
|
58139
58223
|
return { action: "skip" };
|
|
58140
58224
|
if (chatInfo.type === "group" && chatInfo.agentRoutingMode !== "active") {
|
|
58141
58225
|
const mentions = content.mentions ?? [];
|
|
58142
|
-
const isMentioned = mentions.some((mention) => mention.user_id
|
|
58226
|
+
const isMentioned = mentions.some((mention) => mentionTargetsUser(mention.user_id, this.opts.agentUserId, "agent"));
|
|
58143
58227
|
if (!isMentioned)
|
|
58144
58228
|
return { action: "skip" };
|
|
58145
58229
|
}
|
|
@@ -59139,8 +59223,17 @@ parall whoami
|
|
|
59139
59223
|
parall members list # All org members (humans + agents)
|
|
59140
59224
|
parall agents list # Agents only
|
|
59141
59225
|
parall users get prll://usr_xxx # Get user details by ID
|
|
59226
|
+
parall members profile prll://usr_xxx # A member's public profile (title / about)
|
|
59227
|
+
parall agents instructions # Your own private Instructions (admin-maintained)
|
|
59142
59228
|
\`\`\`
|
|
59143
59229
|
|
|
59230
|
+
Every member carries an org-scoped public profile: \`title\` (role, e.g.
|
|
59231
|
+
"Platform Lead") and \`description\` (a short about). \`members list\` includes
|
|
59232
|
+
both \u2014 use them to route work to the right person or agent. Your own system
|
|
59233
|
+
prompt already contains your public profile and your private Instructions;
|
|
59234
|
+
you cannot edit either of them \u2014 if yours should change, DM a Human org
|
|
59235
|
+
admin and ask.
|
|
59236
|
+
|
|
59144
59237
|
Create a hosted agent when the user asks for a Parall-managed runtime. Hosted
|
|
59145
59238
|
provisioning is asynchronous: creation means the agent identity, API key, and
|
|
59146
59239
|
machine record were accepted, not that the runtime is online yet. Use \`--wait\`
|
|
@@ -62703,7 +62796,7 @@ async function getAgentMeWithLegacyFallback(client, orgId) {
|
|
|
62703
62796
|
throw err;
|
|
62704
62797
|
}
|
|
62705
62798
|
const user = await client.getMe();
|
|
62706
|
-
return { ...user, agent_profile: null };
|
|
62799
|
+
return { ...user, agent_profile: null, public_profile: null };
|
|
62707
62800
|
}
|
|
62708
62801
|
}
|
|
62709
62802
|
function resolveProviderEnv() {
|
|
@@ -62743,11 +62836,9 @@ async function main() {
|
|
|
62743
62836
|
ensureParallProvider(config.codexHome, config.apiUrl, agentLog);
|
|
62744
62837
|
agentLog.info("parall custom provider configured (Responses API HTTP/SSE mode)");
|
|
62745
62838
|
}
|
|
62746
|
-
|
|
62747
|
-
|
|
62748
|
-
|
|
62749
|
-
description: me.agent_profile?.description ?? void 0
|
|
62750
|
-
};
|
|
62839
|
+
let agentIdentity = identityFromMe(me);
|
|
62840
|
+
let lastIdentitySnapshot = JSON.stringify(agentIdentity);
|
|
62841
|
+
let lastKnownAgentProfile = me.agent_profile;
|
|
62751
62842
|
const runtimeKey = config.runtimeKey || buildCodexRuntimeKey(agentUserId);
|
|
62752
62843
|
const mainContextFilePath = contextFilePathForSession(config.stateDir, runtimeKey);
|
|
62753
62844
|
const sessionStateFilePath = sessionStateFilePathForRuntime(config.stateDir, runtimeKey);
|
|
@@ -62797,15 +62888,17 @@ async function main() {
|
|
|
62797
62888
|
});
|
|
62798
62889
|
const refreshPlatformConfig = async () => {
|
|
62799
62890
|
const updated = await configMgr.fetch();
|
|
62800
|
-
let
|
|
62801
|
-
|
|
62802
|
-
|
|
62803
|
-
|
|
62804
|
-
|
|
62805
|
-
|
|
62806
|
-
|
|
62891
|
+
let refreshedMe;
|
|
62892
|
+
try {
|
|
62893
|
+
refreshedMe = await getAgentMeWithLegacyFallback(client, config.orgId);
|
|
62894
|
+
} catch (err) {
|
|
62895
|
+
agentLog.warn(`platform config refresh: /agents/me refetch failed (keeping last-known identity): ${String(err)}`);
|
|
62896
|
+
}
|
|
62897
|
+
if (refreshedMe) {
|
|
62898
|
+
agentIdentity = identityFromMe(refreshedMe);
|
|
62899
|
+
lastKnownAgentProfile = refreshedMe.agent_profile;
|
|
62807
62900
|
}
|
|
62808
|
-
const isPin = deriveModelIsPin(updated,
|
|
62901
|
+
const isPin = deriveModelIsPin(updated, lastKnownAgentProfile);
|
|
62809
62902
|
adapter.updateConfig({
|
|
62810
62903
|
model: resolveRuntimeModel(isPin, updated.model, config.model) ?? null,
|
|
62811
62904
|
reasoningEffort: updated.thinkingEffort ?? config.reasoningEffort ?? null
|
|
@@ -62820,8 +62913,10 @@ async function main() {
|
|
|
62820
62913
|
promptWritten = false;
|
|
62821
62914
|
agentLog.warn(`system prompt refresh write failed (retrying next refresh): ${String(err)}`);
|
|
62822
62915
|
}
|
|
62823
|
-
|
|
62916
|
+
const identitySnapshot = JSON.stringify(agentIdentity);
|
|
62917
|
+
if (promptWritten && (joinedFragments !== lastCapabilityFragments || identitySnapshot !== lastIdentitySnapshot)) {
|
|
62824
62918
|
lastCapabilityFragments = joinedFragments;
|
|
62919
|
+
lastIdentitySnapshot = identitySnapshot;
|
|
62825
62920
|
adapter.requestProcessRestart();
|
|
62826
62921
|
}
|
|
62827
62922
|
};
|