@parall/sdk 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/dist/browser-viewer.d.ts +11 -0
- package/dist/browser-viewer.d.ts.map +1 -0
- package/dist/browser-viewer.js +14 -0
- package/dist/client.d.ts +25 -16
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +47 -6
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +11 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/types.d.ts +197 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +26 -0
- package/package.json +1 -1
- package/src/browser-viewer.ts +22 -0
- package/src/client.ts +83 -8
- package/src/constants.ts +16 -0
- package/src/index.ts +7 -6
- package/src/types.ts +251 -0
package/src/constants.ts
CHANGED
|
@@ -377,6 +377,14 @@ export const ENDPOINTS = {
|
|
|
377
377
|
`${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
|
|
378
378
|
ORG_MEMBER_TASKS: (orgId: string, memberId: string) =>
|
|
379
379
|
`${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
|
|
380
|
+
// Org-scoped public profile (title / description). GET readable by every
|
|
381
|
+
// active member; PATCH is CAS-guarded (expected_version).
|
|
382
|
+
ORG_MEMBER_PROFILE: (orgId: string, userId: string) =>
|
|
383
|
+
`${API_BASE}/orgs/${orgId}/members/${userId}/profile`,
|
|
384
|
+
// Private agent Instructions — visibility gated server-side
|
|
385
|
+
// (agent self + Human org admin/owner). Never cached.
|
|
386
|
+
AGENT_INSTRUCTIONS: (orgId: string, agentId: string) =>
|
|
387
|
+
`${API_BASE}/orgs/${orgId}/agents/${agentId}/instructions`,
|
|
380
388
|
REF_SEARCH: (orgId: string) => `${API_BASE}/orgs/${orgId}/refs/search`,
|
|
381
389
|
|
|
382
390
|
// Direct messages (org-scoped, atomic find-or-create + send)
|
|
@@ -814,6 +822,14 @@ export const ENDPOINTS = {
|
|
|
814
822
|
// Feature flags (org-scoped, server-evaluated)
|
|
815
823
|
FEATURE_FLAGS: (orgId: string) => `${API_BASE}/orgs/${orgId}/feature-flags`,
|
|
816
824
|
|
|
825
|
+
// Team templates (org-scoped, owner/admin only)
|
|
826
|
+
TEMPLATES: (orgId: string) => `${API_BASE}/orgs/${orgId}/templates`,
|
|
827
|
+
TEMPLATE: (orgId: string, templateId: string) =>
|
|
828
|
+
`${API_BASE}/orgs/${orgId}/templates/${templateId}`,
|
|
829
|
+
TEMPLATE_DEPLOYMENTS: (orgId: string) => `${API_BASE}/orgs/${orgId}/template-deployments`,
|
|
830
|
+
TEMPLATE_DEPLOYMENT: (orgId: string, deploymentId: string) =>
|
|
831
|
+
`${API_BASE}/orgs/${orgId}/template-deployments/${deploymentId}`,
|
|
832
|
+
|
|
817
833
|
// Billing & Credits (org-scoped)
|
|
818
834
|
BILLING: (orgId: string) => `${API_BASE}/orgs/${orgId}/billing`,
|
|
819
835
|
BILLING_TRANSACTIONS: (orgId: string) => `${API_BASE}/orgs/${orgId}/billing/transactions`,
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './constants.js';
|
|
3
|
-
export { ParallClient, ApiError } from './client.js';
|
|
1
|
+
export * from './browser-viewer.js';
|
|
4
2
|
export type { ParallClientOptions } from './client.js';
|
|
5
|
-
export {
|
|
3
|
+
export { ApiError, ParallClient } from './client.js';
|
|
4
|
+
export * from './constants.js';
|
|
5
|
+
export * from './types.js';
|
|
6
6
|
export type {
|
|
7
7
|
ParallWsOptions,
|
|
8
|
+
WsClientEventMap,
|
|
8
9
|
WsConnectionState,
|
|
9
|
-
WsEventType,
|
|
10
10
|
WsEventHandler,
|
|
11
|
-
|
|
11
|
+
WsEventType,
|
|
12
12
|
} from './ws.js';
|
|
13
|
+
export { ParallWs } from './ws.js';
|
package/src/types.ts
CHANGED
|
@@ -138,6 +138,38 @@ export type MessageType =
|
|
|
138
138
|
|
|
139
139
|
export const MENTION_ALL_USER_ID = 'all';
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Member-type-filtered variants of the @all broadcast mention (group chats
|
|
143
|
+
* only): identical notification semantics, recipient set limited to human /
|
|
144
|
+
* agent members respectively.
|
|
145
|
+
*/
|
|
146
|
+
export const MENTION_ALL_HUMANS_USER_ID = 'allhuman';
|
|
147
|
+
export const MENTION_ALL_AGENTS_USER_ID = 'allagent';
|
|
148
|
+
|
|
149
|
+
/** True when a mention user_id is a broadcast token rather than a usr_ id. */
|
|
150
|
+
export function isBroadcastMentionId(userId: string): boolean {
|
|
151
|
+
return (
|
|
152
|
+
userId === MENTION_ALL_USER_ID ||
|
|
153
|
+
userId === MENTION_ALL_HUMANS_USER_ID ||
|
|
154
|
+
userId === MENTION_ALL_AGENTS_USER_ID
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* True when a mention user_id addresses the given viewer — either their own
|
|
160
|
+
* usr_ id, @all, or the typed broadcast matching their user type.
|
|
161
|
+
*/
|
|
162
|
+
export function mentionTargetsUser(
|
|
163
|
+
mentionUserId: string,
|
|
164
|
+
userId: string,
|
|
165
|
+
userType: UserType,
|
|
166
|
+
): boolean {
|
|
167
|
+
if (mentionUserId === userId || mentionUserId === MENTION_ALL_USER_ID) return true;
|
|
168
|
+
if (mentionUserId === MENTION_ALL_HUMANS_USER_ID) return userType === 'human';
|
|
169
|
+
if (mentionUserId === MENTION_ALL_AGENTS_USER_ID) return userType === 'agent';
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
|
|
141
173
|
export interface Mention {
|
|
142
174
|
user_id: string;
|
|
143
175
|
offset: number;
|
|
@@ -401,9 +433,48 @@ export interface OrgMember {
|
|
|
401
433
|
user_id: string;
|
|
402
434
|
role: OrgMemberRole;
|
|
403
435
|
joined_at: string;
|
|
436
|
+
// Org-scoped public profile projection. Missing profile row reads as
|
|
437
|
+
// empty strings with profile_version 0.
|
|
438
|
+
title: string;
|
|
439
|
+
description: string;
|
|
440
|
+
profile_version: number;
|
|
404
441
|
user?: User;
|
|
405
442
|
}
|
|
406
443
|
|
|
444
|
+
// Org-scoped public member profile (Human and Agent alike). Never carries
|
|
445
|
+
// private agent Instructions.
|
|
446
|
+
export interface MemberProfile {
|
|
447
|
+
user_id: string;
|
|
448
|
+
display_name: string;
|
|
449
|
+
type: UserType;
|
|
450
|
+
title: string;
|
|
451
|
+
description: string;
|
|
452
|
+
profile_version: number;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// Full-replacement update over {title, description} with a version CAS.
|
|
456
|
+
// expected_version 0 = first write (no profile row yet). A stale version
|
|
457
|
+
// gets 409 PROFILE_VERSION_CONFLICT with error.details.current_version.
|
|
458
|
+
export interface UpdateMemberProfileRequest {
|
|
459
|
+
title: string;
|
|
460
|
+
description: string;
|
|
461
|
+
expected_version: number;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Private agent Instructions — org-admin maintained runtime context.
|
|
465
|
+
export interface AgentInstructions {
|
|
466
|
+
agent_user_id: string;
|
|
467
|
+
instructions: string;
|
|
468
|
+
version: number;
|
|
469
|
+
updated_at?: string;
|
|
470
|
+
updated_by?: string;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export interface UpdateAgentInstructionsRequest {
|
|
474
|
+
instructions: string;
|
|
475
|
+
expected_version: number;
|
|
476
|
+
}
|
|
477
|
+
|
|
407
478
|
// Team — a named group of org members, referenced in wiki ACLs as `@slug`.
|
|
408
479
|
export interface Team {
|
|
409
480
|
id: string;
|
|
@@ -561,6 +632,159 @@ export interface FeatureFlagsResponse {
|
|
|
561
632
|
flags: Record<string, boolean | string | number>;
|
|
562
633
|
}
|
|
563
634
|
|
|
635
|
+
// ============================================================
|
|
636
|
+
// Team Template Types
|
|
637
|
+
// ============================================================
|
|
638
|
+
|
|
639
|
+
export type TemplateParameterInputType = 'text' | 'select' | 'multi';
|
|
640
|
+
export type TemplateParameterValue = string | string[];
|
|
641
|
+
|
|
642
|
+
export interface TemplateParameter {
|
|
643
|
+
key: string;
|
|
644
|
+
label: string;
|
|
645
|
+
input_type: TemplateParameterInputType;
|
|
646
|
+
options?: string[];
|
|
647
|
+
default?: TemplateParameterValue;
|
|
648
|
+
required?: boolean;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface TemplateDependency {
|
|
652
|
+
type: 'clip';
|
|
653
|
+
ref: string;
|
|
654
|
+
required?: boolean;
|
|
655
|
+
degraded_note?: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface TemplateAgentPublicProfile {
|
|
659
|
+
title: string;
|
|
660
|
+
description: string;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
export interface TemplateAgentSpec {
|
|
664
|
+
key: string;
|
|
665
|
+
display_name: string;
|
|
666
|
+
public_profile: TemplateAgentPublicProfile;
|
|
667
|
+
instructions: string;
|
|
668
|
+
runtime_type?: string;
|
|
669
|
+
model?: string | null;
|
|
670
|
+
compute?: {
|
|
671
|
+
machine_type: 'cloud';
|
|
672
|
+
machine_label?: string;
|
|
673
|
+
} | null;
|
|
674
|
+
dependencies?: TemplateDependency[];
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export interface TemplateWorkspaceScaffold {
|
|
678
|
+
channels: Array<{
|
|
679
|
+
purpose?: string;
|
|
680
|
+
name_pattern: string;
|
|
681
|
+
}>;
|
|
682
|
+
schedules?: Array<{
|
|
683
|
+
agent_key: string;
|
|
684
|
+
name: string;
|
|
685
|
+
cron: string;
|
|
686
|
+
description: string;
|
|
687
|
+
}>;
|
|
688
|
+
project?: {
|
|
689
|
+
name_pattern: string;
|
|
690
|
+
} | null;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
export interface TemplateDefinition {
|
|
694
|
+
name: string;
|
|
695
|
+
mission: string;
|
|
696
|
+
scope_tags?: string[];
|
|
697
|
+
outcomes?: string[];
|
|
698
|
+
agents: TemplateAgentSpec[];
|
|
699
|
+
workspace_scaffold: TemplateWorkspaceScaffold;
|
|
700
|
+
parameters?: TemplateParameter[];
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// Explicit organization catalog projection. It intentionally does not extend
|
|
704
|
+
// the authoring types: future authoring fields must never become public by
|
|
705
|
+
// inheritance. Instructions, runtime/model/compute, and workspace seed data
|
|
706
|
+
// stay on the cluster-internal CRUD and server-side deployment path.
|
|
707
|
+
export interface TemplateCatalogAgentSpec {
|
|
708
|
+
key: string;
|
|
709
|
+
display_name: string;
|
|
710
|
+
public_profile: TemplateAgentPublicProfile;
|
|
711
|
+
dependencies?: Array<Pick<TemplateDependency, 'type' | 'ref' | 'required'>>;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export interface TemplateCatalogDefinition {
|
|
715
|
+
name: string;
|
|
716
|
+
mission: string;
|
|
717
|
+
scope_tags?: string[];
|
|
718
|
+
outcomes?: string[];
|
|
719
|
+
agents: TemplateCatalogAgentSpec[];
|
|
720
|
+
parameters?: TemplateParameter[];
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Resolved in the target organization at catalog-read time. This is not part
|
|
724
|
+
// of the persisted authoring definition and carries no readiness/connection
|
|
725
|
+
// state.
|
|
726
|
+
export interface TemplateDependencyMetadata {
|
|
727
|
+
type: 'clip';
|
|
728
|
+
ref: string;
|
|
729
|
+
display_name: string;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export interface Template {
|
|
733
|
+
id: string;
|
|
734
|
+
version: string;
|
|
735
|
+
/** Opaque token pinning the version + exact definition shown to the user. */
|
|
736
|
+
revision: string;
|
|
737
|
+
name: string;
|
|
738
|
+
definition: TemplateCatalogDefinition;
|
|
739
|
+
dependency_metadata?: TemplateDependencyMetadata[];
|
|
740
|
+
status: 'active' | 'archived';
|
|
741
|
+
created_at: string;
|
|
742
|
+
updated_at: string;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export interface DeployTemplateRequest {
|
|
746
|
+
template_id: string;
|
|
747
|
+
template_revision: string;
|
|
748
|
+
parameter_values?: Record<string, TemplateParameterValue>;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export type TemplateDeploymentAgentState = 'up' | 'provisioning' | 'error';
|
|
752
|
+
|
|
753
|
+
export interface TemplateDeploymentReport {
|
|
754
|
+
deployment_id: string;
|
|
755
|
+
status: 'deployed';
|
|
756
|
+
team: {
|
|
757
|
+
name: string;
|
|
758
|
+
main_chat_id: string;
|
|
759
|
+
};
|
|
760
|
+
agents: Array<{
|
|
761
|
+
key: string;
|
|
762
|
+
agent_id: string;
|
|
763
|
+
display_name: string;
|
|
764
|
+
public_profile: TemplateAgentPublicProfile;
|
|
765
|
+
runtime: string;
|
|
766
|
+
state: TemplateDeploymentAgentState;
|
|
767
|
+
}>;
|
|
768
|
+
resources: {
|
|
769
|
+
chats: Array<{ id: string; name: string }>;
|
|
770
|
+
schedules: Array<{ id: string; name: string }>;
|
|
771
|
+
project_id?: string;
|
|
772
|
+
};
|
|
773
|
+
dependencies: Array<{
|
|
774
|
+
type: 'clip';
|
|
775
|
+
ref: string;
|
|
776
|
+
name?: string;
|
|
777
|
+
required: boolean;
|
|
778
|
+
connected: boolean;
|
|
779
|
+
declared_by: string[];
|
|
780
|
+
}>;
|
|
781
|
+
kickoff: {
|
|
782
|
+
sent: boolean;
|
|
783
|
+
message_id?: string;
|
|
784
|
+
error?: string;
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
564
788
|
// ============================================================
|
|
565
789
|
// API Request Types
|
|
566
790
|
// ============================================================
|
|
@@ -699,6 +923,9 @@ export interface CreateAgentRequest {
|
|
|
699
923
|
thinking_effort?: string; // model-dependent: "minimal" | "low" | "medium" | "high" | "xhigh" | "max"
|
|
700
924
|
agent_permissions?: string[];
|
|
701
925
|
runtime_type?: string; // "openclaw" | "claude-code" | "codex"; default "openclaw"
|
|
926
|
+
// Preferred write field for the agent's private instruction text.
|
|
927
|
+
instructions?: string;
|
|
928
|
+
/** @deprecated Same-value alias of `instructions`; loses when both are set. */
|
|
702
929
|
description?: string;
|
|
703
930
|
machine_type?: string;
|
|
704
931
|
machine_label?: string; // preset: "lite" | "standard" | "pro" | "custom"
|
|
@@ -795,6 +1022,9 @@ export interface UpdateAgentRequest {
|
|
|
795
1022
|
agent_model?: string;
|
|
796
1023
|
model_management?: string;
|
|
797
1024
|
agent_permissions?: string[];
|
|
1025
|
+
// Preferred write field for the agent's private instruction text.
|
|
1026
|
+
instructions?: string;
|
|
1027
|
+
/** @deprecated Same-value alias of `instructions`; loses when both are set. */
|
|
798
1028
|
description?: string;
|
|
799
1029
|
thinking_effort?: string;
|
|
800
1030
|
}
|
|
@@ -952,7 +1182,18 @@ export interface AgentProfile {
|
|
|
952
1182
|
machine_id: string | null;
|
|
953
1183
|
hosting_mode?: 'hosted' | 'self_hosted' | 'platform_runtime';
|
|
954
1184
|
runtime_type: string;
|
|
1185
|
+
/**
|
|
1186
|
+
* @deprecated Alias of `instructions` kept for pre-rename readers; the
|
|
1187
|
+
* server keeps both byte-identical. Use `instructions` (and the
|
|
1188
|
+
* dedicated instructions endpoints) instead.
|
|
1189
|
+
*/
|
|
955
1190
|
description: string | null;
|
|
1191
|
+
// Private Instructions (admin-maintained runtime context). Redacted for
|
|
1192
|
+
// non-admin viewers on list surfaces, same as description.
|
|
1193
|
+
instructions?: string | null;
|
|
1194
|
+
instructions_version?: number;
|
|
1195
|
+
instructions_updated_at?: string | null;
|
|
1196
|
+
instructions_updated_by?: string | null;
|
|
956
1197
|
thinking_effort: string | null;
|
|
957
1198
|
run_config?: RunConfig;
|
|
958
1199
|
created_by: string;
|
|
@@ -972,6 +1213,10 @@ export interface AgentPresence {
|
|
|
972
1213
|
|
|
973
1214
|
export interface AgentWithRuntime extends User {
|
|
974
1215
|
agent_profile?: AgentProfile | null;
|
|
1216
|
+
// Org-scoped public profile (title / public description) for the org the
|
|
1217
|
+
// request is scoped to. Runtimes read it from /agents/me to build the
|
|
1218
|
+
// public identity prompt section.
|
|
1219
|
+
public_profile?: MemberProfile | null;
|
|
975
1220
|
machine?: Machine | null;
|
|
976
1221
|
presence?: AgentPresence | null;
|
|
977
1222
|
}
|
|
@@ -1098,6 +1343,12 @@ export interface MachineBrowserProfileViewerData {
|
|
|
1098
1343
|
turn?: { url: string; username?: string; credential?: string };
|
|
1099
1344
|
}
|
|
1100
1345
|
|
|
1346
|
+
/** Daemon reply body for one machine.browser_profile.viewer request. */
|
|
1347
|
+
export interface MachineBrowserProfileViewerResponse {
|
|
1348
|
+
result?: Record<string, unknown>;
|
|
1349
|
+
error?: { code?: string; message: string };
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1101
1352
|
export interface AgentNewSessionData {
|
|
1102
1353
|
previous_session_id?: string;
|
|
1103
1354
|
}
|