@proteos/sdk 0.86.0 → 0.87.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/index.cjs +63 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +443 -19
- package/dist/index.d.ts +443 -19
- package/dist/index.js +63 -3
- package/dist/index.js.map +1 -1
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/{types-CWj1h9l0.d.cts → types-D38dRFU7.d.cts} +7 -1
- package/dist/{types-CWj1h9l0.d.ts → types-D38dRFU7.d.ts} +7 -1
- package/package.json +3 -3
- package/src/agent/index.ts +28 -0
- package/src/agent/model-types.ts +23 -1
- package/src/agent/models.ts +16 -3
- package/src/agent/session-types.ts +351 -12
- package/src/agent/sessions.ts +108 -1
- package/src/agent/toolsets.ts +17 -0
- package/src/agent/types.ts +34 -0
- package/src/client.ts +1 -0
- package/src/index.ts +29 -1
- package/src/knowledge/index.ts +1 -0
- package/src/knowledge/spaces.ts +14 -0
- package/src/knowledge/types.ts +13 -0
- package/src/types/options.ts +6 -0
package/src/agent/toolsets.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
} from './types.js'
|
|
11
11
|
|
|
12
12
|
const TOOLSETS_BASE_PATH = '/agents/v1/toolsets'
|
|
13
|
+
const PLATFORM_TOOLS_PATH = '/agents/v1/platform-tools'
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Service for managing Toolsets — the hardcoded platform toolsets (read-only)
|
|
@@ -29,6 +30,14 @@ export interface ToolsetService {
|
|
|
29
30
|
* @throws {ProteosError} 404.
|
|
30
31
|
*/
|
|
31
32
|
listTools(key: string): Promise<ToolsetToolSummary[]>
|
|
33
|
+
/**
|
|
34
|
+
* Lists every platform tool once, each with the platform toolset that serves
|
|
35
|
+
* it. An agent may list any of these names in its `tools` as it is: no Tool
|
|
36
|
+
* of that key is needed. A Tool the org saves under the same key replaces the
|
|
37
|
+
* platform tool for its agents. A name several toolsets serve is the first
|
|
38
|
+
* one's, in the order `list({ kind: 'platform' })` returns them.
|
|
39
|
+
*/
|
|
40
|
+
listPlatformTools(): Promise<ToolsetToolSummary[]>
|
|
32
41
|
/** Creates a custom toolset. @throws {ProteosError} 400/409. */
|
|
33
42
|
create(request: CreateToolsetRequest): Promise<Toolset>
|
|
34
43
|
/** Fully replaces a custom toolset's definition. @throws {ProteosError} 404/400. */
|
|
@@ -62,6 +71,14 @@ export class ToolsetServiceImpl implements ToolsetService {
|
|
|
62
71
|
return response.data
|
|
63
72
|
}
|
|
64
73
|
|
|
74
|
+
async listPlatformTools(): Promise<ToolsetToolSummary[]> {
|
|
75
|
+
const response = await this.client.request<{ data: ToolsetToolSummary[] }>(
|
|
76
|
+
'GET',
|
|
77
|
+
PLATFORM_TOOLS_PATH,
|
|
78
|
+
)
|
|
79
|
+
return response.data
|
|
80
|
+
}
|
|
81
|
+
|
|
65
82
|
async create(request: CreateToolsetRequest): Promise<Toolset> {
|
|
66
83
|
return this.client.request<Toolset>('POST', TOOLSETS_BASE_PATH, request)
|
|
67
84
|
}
|
package/src/agent/types.ts
CHANGED
|
@@ -44,6 +44,16 @@ export interface ModelConfig {
|
|
|
44
44
|
thinking?: boolean
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* How an agent's sessions run. `durable` runs them on a provider that keeps a
|
|
49
|
+
* turn going through restarts and gives the session a sandbox (long-running
|
|
50
|
+
* work; Anthropic Managed Agents today). `embedded` runs the loop inside the
|
|
51
|
+
* agent service: replies stream while the model writes them, and there is no
|
|
52
|
+
* sandbox. The value names the kind of runtime, not the vendor behind it, and
|
|
53
|
+
* `embedded` is about where the loop runs, not about where the chat is shown.
|
|
54
|
+
*/
|
|
55
|
+
export type AgentRuntime = 'durable' | 'embedded'
|
|
56
|
+
|
|
47
57
|
/**
|
|
48
58
|
* A configured persona: a system prompt + model config + the skills, tools,
|
|
49
59
|
* sub-agents and MCP servers it can use. All references are by key (immutable):
|
|
@@ -75,6 +85,14 @@ export interface Agent extends AuditFields {
|
|
|
75
85
|
* navigate / open_record.
|
|
76
86
|
*/
|
|
77
87
|
has_workspace: boolean
|
|
88
|
+
/**
|
|
89
|
+
* Keeps per-person memory: the agent remembers how each person likes to work
|
|
90
|
+
* and where their last session left off, as notes in that person's own
|
|
91
|
+
* (personal) knowledge space.
|
|
92
|
+
*/
|
|
93
|
+
has_memory: boolean
|
|
94
|
+
/** What runs this agent's sessions. A session keeps the runtime it was created with. */
|
|
95
|
+
runtime: AgentRuntime
|
|
78
96
|
version: number
|
|
79
97
|
}
|
|
80
98
|
|
|
@@ -92,6 +110,9 @@ export interface CreateAgentRequest {
|
|
|
92
110
|
toolsets?: string[]
|
|
93
111
|
is_org_default?: boolean
|
|
94
112
|
has_workspace?: boolean
|
|
113
|
+
has_memory?: boolean
|
|
114
|
+
/** Defaults to `durable`. */
|
|
115
|
+
runtime?: AgentRuntime
|
|
95
116
|
}
|
|
96
117
|
|
|
97
118
|
export interface UpdateAgentRequest {
|
|
@@ -107,6 +128,8 @@ export interface UpdateAgentRequest {
|
|
|
107
128
|
toolsets?: string[]
|
|
108
129
|
is_org_default?: boolean
|
|
109
130
|
has_workspace?: boolean
|
|
131
|
+
has_memory?: boolean
|
|
132
|
+
runtime?: AgentRuntime
|
|
110
133
|
}
|
|
111
134
|
|
|
112
135
|
export type ListAgentsOptions = AgentResourceListOptions
|
|
@@ -280,6 +303,11 @@ export interface Tool extends AuditFields {
|
|
|
280
303
|
kind: ToolKind
|
|
281
304
|
input_schema: Attribute[]
|
|
282
305
|
binding?: ToolBinding | null
|
|
306
|
+
/**
|
|
307
|
+
* Whether calling the tool is known to change nothing, so that its call may run
|
|
308
|
+
* alongside others. Set on platform tools the platform marks so; absent otherwise.
|
|
309
|
+
*/
|
|
310
|
+
is_read_only?: boolean
|
|
283
311
|
version: number
|
|
284
312
|
}
|
|
285
313
|
|
|
@@ -366,6 +394,12 @@ export interface ToolsetToolSummary {
|
|
|
366
394
|
name: string
|
|
367
395
|
title?: string
|
|
368
396
|
description?: string
|
|
397
|
+
/**
|
|
398
|
+
* The platform toolset that serves the tool. Set where the platform's tools
|
|
399
|
+
* are listed together (`toolsets.listPlatformTools`); absent in the list of
|
|
400
|
+
* one toolset, which the request already names.
|
|
401
|
+
*/
|
|
402
|
+
toolset?: string
|
|
369
403
|
}
|
|
370
404
|
|
|
371
405
|
// ---------------------------------------------------------------------------
|
package/src/client.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -41,8 +41,11 @@ export type {
|
|
|
41
41
|
AgentArtifactsPayload,
|
|
42
42
|
AgentMessagePayload,
|
|
43
43
|
AgentResourceListOptions,
|
|
44
|
+
AgentRuntime,
|
|
44
45
|
AgentService,
|
|
45
46
|
AppendEventRequest,
|
|
47
|
+
AppendSpeechRequest,
|
|
48
|
+
AwaitingToolUse,
|
|
46
49
|
BooleanAnswer,
|
|
47
50
|
BooleanCriteria,
|
|
48
51
|
BooleanQuestion,
|
|
@@ -65,9 +68,13 @@ export type {
|
|
|
65
68
|
DecisionQuestions,
|
|
66
69
|
DecisionQuestionType,
|
|
67
70
|
DecisionResult,
|
|
71
|
+
DelegatedSessionUpdatedPayload,
|
|
72
|
+
DeltaBoundaryPayload,
|
|
73
|
+
DeltaEventType,
|
|
68
74
|
DependentAgent,
|
|
69
75
|
DependentSyncResult,
|
|
70
76
|
EmptyPayload,
|
|
77
|
+
EndVoiceRequest,
|
|
71
78
|
ErrorPayload,
|
|
72
79
|
EventType,
|
|
73
80
|
FileBlock,
|
|
@@ -88,7 +95,10 @@ export type {
|
|
|
88
95
|
McpServerOAuth,
|
|
89
96
|
McpServerService,
|
|
90
97
|
McpToolSummary,
|
|
98
|
+
MessageDeltaPayload,
|
|
91
99
|
ModelConfig,
|
|
100
|
+
ModelInfo,
|
|
101
|
+
ModelProviderName,
|
|
92
102
|
ModelRequestEndPayload,
|
|
93
103
|
ModelRequestStartPayload,
|
|
94
104
|
ModelService,
|
|
@@ -99,24 +109,34 @@ export type {
|
|
|
99
109
|
PromptService,
|
|
100
110
|
PromptVersion,
|
|
101
111
|
QueryBinding,
|
|
112
|
+
ReasoningDeltaPayload,
|
|
102
113
|
ReasoningPayload,
|
|
103
114
|
ResultBlock,
|
|
104
115
|
ScoreAnswer,
|
|
105
116
|
ScoreQuestion,
|
|
106
117
|
Session,
|
|
118
|
+
SessionDeltaEntry,
|
|
119
|
+
SessionDeltaFrame,
|
|
120
|
+
SessionDeltaStreamOptions,
|
|
107
121
|
SessionEvent,
|
|
108
122
|
SessionEventEnvelope,
|
|
109
123
|
SessionEventsOptions,
|
|
110
124
|
SessionIdlePayload,
|
|
125
|
+
SessionRunningPayload,
|
|
111
126
|
SessionService,
|
|
112
127
|
SessionStatus,
|
|
113
128
|
SessionStreamOptions,
|
|
129
|
+
SessionToolKind,
|
|
114
130
|
SessionUpdatedPayload,
|
|
115
131
|
Skill,
|
|
116
132
|
SkillBundle,
|
|
117
133
|
SkillService,
|
|
118
134
|
SkillVersion,
|
|
135
|
+
SpeechPayload,
|
|
136
|
+
SpeechSegment,
|
|
119
137
|
StartMcpOAuthResponse,
|
|
138
|
+
StartVoiceRequest,
|
|
139
|
+
StartVoiceResponse,
|
|
120
140
|
StopReason,
|
|
121
141
|
StructuredText,
|
|
122
142
|
TextBlock,
|
|
@@ -130,7 +150,9 @@ export type {
|
|
|
130
150
|
ToolsetKind,
|
|
131
151
|
ToolsetService,
|
|
132
152
|
ToolsetToolSummary,
|
|
153
|
+
ToolUseDeltaPayload,
|
|
133
154
|
ToolUsePayload,
|
|
155
|
+
ToolUseStartPayload,
|
|
134
156
|
Turn,
|
|
135
157
|
UpdateAgentRequest,
|
|
136
158
|
UpdateMcpServerRequest,
|
|
@@ -138,8 +160,13 @@ export type {
|
|
|
138
160
|
UpdateToolRequest,
|
|
139
161
|
UpdateToolsetRequest,
|
|
140
162
|
UserMessagePayload,
|
|
163
|
+
VoiceEndedPayload,
|
|
164
|
+
VoiceEndReason,
|
|
165
|
+
VoiceRequestPayload,
|
|
166
|
+
VoiceSession,
|
|
167
|
+
VoiceStartedPayload,
|
|
141
168
|
} from './agent/index.js'
|
|
142
|
-
export { AgentClient } from './agent/index.js'
|
|
169
|
+
export { AgentClient, isDeltaFrame } from './agent/index.js'
|
|
143
170
|
// Auth types (re-exported from auth/index.ts for convenience)
|
|
144
171
|
export type {
|
|
145
172
|
AddTeamMemberRequest,
|
|
@@ -739,6 +766,7 @@ export type {
|
|
|
739
766
|
SearchContentRequest,
|
|
740
767
|
SearchContentResponse,
|
|
741
768
|
SearchNodesRequest,
|
|
769
|
+
SpaceScope,
|
|
742
770
|
SpaceService,
|
|
743
771
|
UpdateLabelRequest,
|
|
744
772
|
UpdateLinkRequest,
|
package/src/knowledge/index.ts
CHANGED
package/src/knowledge/spaces.ts
CHANGED
|
@@ -37,6 +37,13 @@ export interface SpaceService {
|
|
|
37
37
|
/** Creates a space. The slug is permanent. */
|
|
38
38
|
create(request: CreateSpaceRequest): Promise<KnowledgeSpace>
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Returns the calling user's own personal space, creating it on first use.
|
|
42
|
+
* Takes no arguments: whose space it is comes from the token. A personal
|
|
43
|
+
* space is created holding grants for its owner only.
|
|
44
|
+
*/
|
|
45
|
+
ensurePersonal(): Promise<KnowledgeSpace>
|
|
46
|
+
|
|
40
47
|
/** Updates a space's presentation. The slug cannot be changed. */
|
|
41
48
|
update(slug: string, request: UpdateSpaceRequest): Promise<KnowledgeSpace>
|
|
42
49
|
|
|
@@ -76,6 +83,13 @@ export class SpaceServiceImpl implements SpaceService {
|
|
|
76
83
|
return this.client.request<KnowledgeSpace>('POST', SPACES_BASE_PATH, request)
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
async ensurePersonal(): Promise<KnowledgeSpace> {
|
|
87
|
+
return this.client.request<KnowledgeSpace>(
|
|
88
|
+
'POST',
|
|
89
|
+
`${SPACES_BASE_PATH}/actions/ensure-personal`,
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
79
93
|
async update(slug: string, request: UpdateSpaceRequest): Promise<KnowledgeSpace> {
|
|
80
94
|
return this.client.request<KnowledgeSpace>('PATCH', `${SPACES_BASE_PATH}/${slug}`, request)
|
|
81
95
|
}
|
package/src/knowledge/types.ts
CHANGED
|
@@ -500,8 +500,21 @@ export interface KnowledgeSpace extends AuditFields {
|
|
|
500
500
|
description?: string | null
|
|
501
501
|
color?: string | null
|
|
502
502
|
icon?: string | null
|
|
503
|
+
/**
|
|
504
|
+
* Who the space is for: `shared` (an ordinary org space) or `personal` (one
|
|
505
|
+
* person's own space, where their assistants keep memory notes). Set at
|
|
506
|
+
* creation and never changed.
|
|
507
|
+
*/
|
|
508
|
+
scope: SpaceScope
|
|
509
|
+
/**
|
|
510
|
+
* The person a personal space belongs to; absent on a shared space. It says
|
|
511
|
+
* whose space this is — access still comes only from the space's grants.
|
|
512
|
+
*/
|
|
513
|
+
owner_user_id?: string | null
|
|
503
514
|
}
|
|
504
515
|
|
|
516
|
+
export type SpaceScope = 'shared' | 'personal'
|
|
517
|
+
|
|
505
518
|
/**
|
|
506
519
|
* The reserved filter value meaning "nodes that belong to no space at all".
|
|
507
520
|
* Deliberately not a legal slug (slugs are kebab-case), so it can never collide
|
package/src/types/options.ts
CHANGED
|
@@ -98,4 +98,10 @@ export interface RequestOptions {
|
|
|
98
98
|
headers?: Record<string, string>
|
|
99
99
|
/** AbortSignal for request cancellation */
|
|
100
100
|
signal?: AbortSignal
|
|
101
|
+
/**
|
|
102
|
+
* Let the request outlive the page that sent it (fetch `keepalive`): for the
|
|
103
|
+
* last report a page sends as it is closed. Browsers cap the body of such
|
|
104
|
+
* requests at 64 KB in total.
|
|
105
|
+
*/
|
|
106
|
+
keepalive?: boolean
|
|
101
107
|
}
|