@deepraxis/sdk 0.1.1-dev.98b62a1 → 0.1.1-dev.9932035
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/METHODS.md +68 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +131 -11
- package/dist/generated/sdk.gen.js +320 -10
- package/dist/generated/types.gen.d.ts +1752 -245
- package/dist/operations.generated.js +644 -20
- package/dist/resources.generated.d.ts +55 -8
- package/dist/resources.generated.js +43 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { client } from './client.gen.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Read your conversation with an agent
|
|
6
6
|
*
|
|
7
|
-
* Read your conversation with a
|
|
7
|
+
* Read your conversation with a general agent: the events of your own main session with that agent, the same page sessions.events.list returns — same query parameters, same data + next_page envelope, same event shapes. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service or assume agent answers 400. Use it to collect a reply, to find tool calls waiting for approval, or to learn the real session id without ever asking for one.
|
|
8
8
|
*/
|
|
9
9
|
export const listAgentEvents = (options) => (options.client ?? client).get({
|
|
10
10
|
security: [{
|
|
@@ -22,7 +22,7 @@ export const listAgentEvents = (options) => (options.client ?? client).get({
|
|
|
22
22
|
/**
|
|
23
23
|
* Send events to an agent
|
|
24
24
|
*
|
|
25
|
-
* Talk to a
|
|
25
|
+
* Talk to a general agent: the message goes to your own main session with that agent — one entry per person, created on first use and the same every time after — so no session id is needed. This is sessions.events.send addressed by the agent instead of the session: the same body (user.message with exactly one nonempty text block, user.interrupt, user.tool_confirmation, user.custom_tool_result, user.steer, user.withdraw), the same acknowledgement and the same billing. {agent_id} takes the agent_… id, the eight character identity number or the handle. A service or assume agent answers 400 — it has no main session: reach a service agent over A2A, or open a session explicitly with sessions.create. Read the reply with agents.events.list, or follow it while it is produced with agents.events.stream. Example: POST /agent/v1/agents/agent_example/events with {"events":[{"type":"user.message","content":[{"type":"text","text":"你好"}]}]}.
|
|
26
26
|
*/
|
|
27
27
|
export const sendAgentEvents = (options) => (options.client ?? client).post({
|
|
28
28
|
security: [{
|
|
@@ -44,7 +44,7 @@ export const sendAgentEvents = (options) => (options.client ?? client).post({
|
|
|
44
44
|
/**
|
|
45
45
|
* Follow an agent live
|
|
46
46
|
*
|
|
47
|
-
* Follow an agent live over Server-Sent Events. For a
|
|
47
|
+
* Follow an agent live over Server-Sent Events. For a general agent it is the stream of your own main session with that agent, the same stream sessions.events.stream opens, event_deltas[] previews included; read past events with agents.events.list. An assume agent has no main session: its body is its MCP connections, and this stream is its broadcast point, which every live connection of the agent hears at once. It carries two events, each with an SSE id: inbox.letter_delivered { letter_id, sender, sender_name, summary, thread, create_time } when a letter arrives (the letter stays unread; take it with the agent's inbox tool, the body is not in the event), and cognition.ritual_held { ritual, owner, title, engram, create_time } when a domain gives the agent a memory. Reconnect with the Last-Event-ID header to receive what you missed from a short recent buffer (about an hour); a first connection replays nothing, so read agents.inbox.letters.list for mail already waiting. {agent_id} takes the agent_… id, the eight character identity number or the handle; a service agent answers 400. Closing the stream only drops your subscription and does not stop the agent.
|
|
48
48
|
*/
|
|
49
49
|
export const streamAgentEvents = (options) => (options.client ?? client).sse.get({
|
|
50
50
|
security: [{
|
|
@@ -459,7 +459,7 @@ export const computersList = (options) => (options?.client ?? client).get({
|
|
|
459
459
|
/**
|
|
460
460
|
* Create Computer
|
|
461
461
|
*
|
|
462
|
-
* Create a durable computer: a named machine whose files outlive sessions, for general
|
|
462
|
+
* Create a durable computer: a named machine whose files outlive sessions, for general agents.
|
|
463
463
|
*
|
|
464
464
|
* Praxis extension: MA only has session-scoped temporary containers and memory_stores, not durable browsable computers. Archived files remain readable, but new sessions cannot bind them. environment_id is an optional recipe reference; computers start with a light sandbox and expose the public SDK sandbox_id. Lists include archived computers.
|
|
465
465
|
*/
|
|
@@ -1498,7 +1498,7 @@ export const fileRetrieveUpload = (options) => (options.client ?? client).get({
|
|
|
1498
1498
|
/**
|
|
1499
1499
|
* Create a one-time upload URL
|
|
1500
1500
|
*
|
|
1501
|
-
* Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid
|
|
1501
|
+
* Upload a local file of up to 20 GiB from a coding agent without sending bytes through the model. Provide filename (the stored basename), exact byte count and MIME type. Up to 104857600 bytes, PUT the file to url with curl -T photo.png -H 'Content-Type: image/png' '<url>'; success returns 201 with the file object, and reuse returns 410 CAPABILITY_USED. Above that threshold, split the file into part_size chunks (default 64000000 bytes) and PUT each chunk to its numbered parts[].url in any order; an interrupted client GETs status_url to see the received parts and resends only what is missing, then POSTs complete_url without a body. Part PUTs return 200; completion returns 201 with the file object, including its state, or 400 if a part is missing. A processing file can be polled with files.retrieve until active. Identical part bytes may be retried; changed bytes at the same number return 400. Completion reuse returns 410 CAPABILITY_USED. Each PUT requires the exact signed Content-Length; single-PUT Content-Type must match content_type or be omitted. Expired, revoked, invalid or cross-organization URLs return 404, and so does a link whose upload record no longer exists. A URL that is authentic but names another action returns 403 CAPABILITY_MISMATCH: a status link posted to complete_url answers it, and so does a completion link fetched as status_url. URL lifetime defaults to 900 seconds for single PUT or 604800 (7 days) for multipart, at most 604800; all multipart URLs, including status_url, share an expiry. Multipart creation reserves storage quota. Issuance requires the same unscoped credential as direct file creation. Each issuance creates a new upload and is not idempotent. Example body: {"filename":"photo.png","bytes":2048,"content_type":"image/png"}.
|
|
1502
1502
|
*/
|
|
1503
1503
|
export const fileCreateSignedUpload = (options) => (options.client ?? client).post({
|
|
1504
1504
|
security: [{
|
|
@@ -3876,7 +3876,7 @@ export const sessionsUpdate = (options) => (options.client ?? client).post({
|
|
|
3876
3876
|
/**
|
|
3877
3877
|
* List agents
|
|
3878
3878
|
*
|
|
3879
|
-
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general
|
|
3879
|
+
* List the agents of the workspace behind your API key, newest first, in pages of at most 100 (default 20). Use it to find an agent id before creating a session; to read one agent use agents.retrieve, to see its history use agents.versions.list. Archived agents are hidden unless include_archived is true. Filter kind=general for durable-computer agents, kind=service for per-session environments, or kind=assume for external MCP clients. Pass next_page from the response as page to read the next page; a null next_page means the end.
|
|
3880
3880
|
*/
|
|
3881
3881
|
export const agentsList = (options) => (options?.client ?? client).get({
|
|
3882
3882
|
security: [{
|
|
@@ -4050,7 +4050,7 @@ export const sessionsArchive = (options) => (options.client ?? client).post({
|
|
|
4050
4050
|
/**
|
|
4051
4051
|
* List session events
|
|
4052
4052
|
*
|
|
4053
|
-
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a
|
|
4053
|
+
* Read the event history of a session as a page of events, oldest first by default (order=desc for newest first). Use it after sending a message to collect the reply, to find tool calls that wait for approval or client custom tool results (session.status_idle with stop_reason requires_action lists their event_ids; a request nobody answered within 24 hours is settled as unanswered and the session goes idle with stop_reason request_expired, which the /anthropic/v1 face shows as end_turn), or to audit a run; to follow a running session live use sessions.events.stream instead. Filter by types and by a created_at range on processed_at; pages hold at most 100 events (default 20) and next_page continues. A failed run emits session.error before session.status_terminated. Native history also includes user.steer, user.withdraw, system.notification, system.notification_suppressed (pending background notifications that hit the wake quota and started no run), system.notification_recorded, session.forked, session.goal_changed and session.goal_verification; these are not accepted by the /anthropic/v1 event-type filter. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.list instead. In the path, session_id may also be `main` (your own main session with that agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4054
4054
|
*/
|
|
4055
4055
|
export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
4056
4056
|
security: [{
|
|
@@ -4068,7 +4068,7 @@ export const sessionsEventsList = (options) => (options.client ?? client).get({
|
|
|
4068
4068
|
/**
|
|
4069
4069
|
* Send session events
|
|
4070
4070
|
*
|
|
4071
|
-
* Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a
|
|
4071
|
+
* Attach optional praxis_context={items:[{name,value}]} to user.message for untrusted page context on this turn only (maximum 32 items, 4096 UTF-8 JSON bytes). /anthropic/v1 rejects this field. Send events to a session: user.message (exactly one nonempty text block), user.interrupt, user.tool_confirmation to allow or deny a pending tool call, user.custom_tool_result to return a custom tool result, user.steer to inject a queued user.message into a turn that is still running, and user.withdraw to retract a queued message. The response only acknowledges the inputs; read replies with sessions.events.list or sessions.events.stream. A message sent while the session waits for tool approval is queued (processed_at null) and runs in order after the approval is resolved. Archived sessions reject new messages. To approve, read a pending agent.tool_use or agent.mcp_tool_use event and send {type: "user.tool_confirmation", tool_use_id: <that event id>, result: "allow"} (or deny); include session_thread_id for a child approval. Native confirmations also accept updated_permissions, answers and annotations, which /anthropic/v1 rejects. Both faces accept user.custom_tool_result with custom_tool_use_id from agent.custom_tool_use.id or the requires_action stop_reason.event_ids. Unlike Anthropic, result content accepts only text blocks (omit it for an empty array). Omitted or null is_error means false. The server routes child calls by id; session_thread_id is rejected in this input. Unknown call ids return 400; duplicate results or calls no longer waiting return 409. This operation addresses one session — normally a worker session an agent dispatched; to talk to a general agent itself, use agents.events.send instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4072
4072
|
*/
|
|
4073
4073
|
export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
4074
4074
|
security: [{
|
|
@@ -4090,7 +4090,7 @@ export const sessionsEventsSend = (options) => (options.client ?? client).post({
|
|
|
4090
4090
|
/**
|
|
4091
4091
|
* Stream session events
|
|
4092
4092
|
*
|
|
4093
|
-
* Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a
|
|
4093
|
+
* Open a Server-Sent Events stream of a session's events in real time. Use it to show a reply as it is produced; to read past events use sessions.events.list. Send a message through sessions.events.send in another request while the stream is open. Closing the stream only drops your subscription and does not stop the agent. Pass event_deltas[]=agent.message, agent.thinking or agent.tool_use to also receive event_start / event_delta previews before the final event. This operation addresses one session — normally a worker session an agent dispatched; to follow a general agent itself, use agents.events.stream instead. In the path, session_id may also be `main` (your own main session with the agent) or a short session name, and either alias then requires agent_id with the agent_… id, the eight character identity number or the handle; only the own face /agent/v1 accepts an alias, /anthropic/v1 requires a real sesn_… id.
|
|
4094
4094
|
*/
|
|
4095
4095
|
export const sessionsEventsStream = (options) => (options.client ?? client).sse.get({
|
|
4096
4096
|
security: [{
|
|
@@ -4390,7 +4390,7 @@ export const deploymentsList = (options) => (options?.client ?? client).get({
|
|
|
4390
4390
|
/**
|
|
4391
4391
|
* Create deployment
|
|
4392
4392
|
*
|
|
4393
|
-
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general
|
|
4393
|
+
* Freeze session parameters as a deployment; this operation does not open a session. Pass an agent id or versioned reference, a name, 1–50 user.message initial events and an environment_id from environments.list. Unlike Anthropic Managed Agents, /agent/v1 also accepts agent_with_overrides (model, permission_mode and cwd) and target=computer for general agents, with environment_id omitted. Cron schedules use five POSIX fields and an IANA timezone. File resources are accepted. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Active schedules run every minute when due; session creation errors pause the deployment. Unsupported tools, mcp_servers, system and skills overrides return 400.
|
|
4394
4394
|
*/
|
|
4395
4395
|
export const deploymentsCreate = (options) => (options.client ?? client).post({
|
|
4396
4396
|
security: [{
|
|
@@ -11001,6 +11001,38 @@ export const mediaAlignAsset = (options) => (options.client ?? client).post({
|
|
|
11001
11001
|
...options.headers
|
|
11002
11002
|
}
|
|
11003
11003
|
});
|
|
11004
|
+
/**
|
|
11005
|
+
* Get HLS renditions
|
|
11006
|
+
*
|
|
11007
|
+
* Read how ready a video asset’s on-demand ladder is, rung by rung, without building anything. Use library_id and asset_id as everywhere else. The answer names the asset, its current version, the asset’s own facts (resource_type, is_audio and duration) and one entry per recorded rung — name, height, the first indexed piece’s width, the rung’s bitrate and stored bytes, and its state (processing while pieces run, ready when every piece is ready, failed when a piece gave up). A ladder that was never requested, and an asset that is not a video, answer an empty renditions rather than an error. This read mints no capability and signs nothing, so play the ladder through the content service, which issues the short-lived play address for the current version. Example: GET /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls.
|
|
11008
|
+
*/
|
|
11009
|
+
export const mediaGetHlsRenditions = (options) => (options.client ?? client).get({
|
|
11010
|
+
security: [{
|
|
11011
|
+
key: 'media-BearerAuth',
|
|
11012
|
+
scheme: 'bearer',
|
|
11013
|
+
type: 'http'
|
|
11014
|
+
}],
|
|
11015
|
+
url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
|
|
11016
|
+
...options
|
|
11017
|
+
});
|
|
11018
|
+
/**
|
|
11019
|
+
* Request HLS renditions
|
|
11020
|
+
*
|
|
11021
|
+
* Build a video asset’s adaptive HLS ladder for its current version, so one asset plays at several clarities on an ordinary player. Use library_id from creation or listing and the asset_id of a video asset; the ladder belongs to the version the asset has now, and a later version gets its own. heights names the rungs to build: a non-empty subset of 480, 720 and 1080 with no repeats, or omitted to build all three. The ladder never upscales — a rung above the source’s short side is dropped, and a list entirely above it keeps its lowest rung. The call is asynchronous and starts paid transcoding: the work runs as the video-transcode-hls model, one piece per rung per ten minutes of source, and it is charged per output minute at that model’s published price to the organization that owns the asset (ADR-146 §5) — a rung the source cannot carry, and a failed rung, are not charged. A source longer than eight hours (28800 seconds) is refused with SOURCE_TOO_LONG before anything is planned. Repeating the call is safe: a rung already processing, ready or failed is left as it is and is never encoded twice. The response is 202 with the asset_id, its current version and one entry per rung — name, height, width, bitrate, bytes and state, where processing means the rung is still being encoded, ready means it plays and failed means it gave up and can be retried by asking again. Poll GET /media/v1/libraries/{library_id}/assets/{asset_id}/hls until every rung is ready, then play the ladder through the content service, which mints the short-lived play address. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/hls with {"heights":[480,720,1080]}.
|
|
11022
|
+
*/
|
|
11023
|
+
export const mediaRequestHlsRenditions = (options) => (options.client ?? client).post({
|
|
11024
|
+
security: [{
|
|
11025
|
+
key: 'media-BearerAuth',
|
|
11026
|
+
scheme: 'bearer',
|
|
11027
|
+
type: 'http'
|
|
11028
|
+
}],
|
|
11029
|
+
url: '/media/v1/libraries/{library_id}/assets/{asset_id}/hls',
|
|
11030
|
+
...options,
|
|
11031
|
+
headers: {
|
|
11032
|
+
'Content-Type': 'application/json',
|
|
11033
|
+
...options.headers
|
|
11034
|
+
}
|
|
11035
|
+
});
|
|
11004
11036
|
/**
|
|
11005
11037
|
* List types
|
|
11006
11038
|
*
|
|
@@ -11243,6 +11275,284 @@ export const ontologySearch = (options) => (options.client ?? client).post({
|
|
|
11243
11275
|
...options.headers
|
|
11244
11276
|
}
|
|
11245
11277
|
});
|
|
11278
|
+
/**
|
|
11279
|
+
* List repositories
|
|
11280
|
+
*
|
|
11281
|
+
* 列出这个组织现有的库,默认库也在其中。库很少,一页通常装得下;用 next_cursor 翻页。先在这里拿到 repository_id,再用它列出或发布包。
|
|
11282
|
+
*/
|
|
11283
|
+
export const registryRepositoriesList = (options) => (options?.client ?? client).get({
|
|
11284
|
+
security: [{
|
|
11285
|
+
key: 'registry-bearerAuth',
|
|
11286
|
+
scheme: 'bearer',
|
|
11287
|
+
type: 'http'
|
|
11288
|
+
}],
|
|
11289
|
+
url: '/registry/v1/repositories',
|
|
11290
|
+
...options
|
|
11291
|
+
});
|
|
11292
|
+
/**
|
|
11293
|
+
* Create repository
|
|
11294
|
+
*
|
|
11295
|
+
* 新建一个库来分类存放包。name 是库的唯一标识,小写字母、数字和连字符,最多 63 个字符,且不能和已有的库重名;display_name 和 description 是给人看的。每个组织本来就有一个默认库,需要新分类时才建;一个库非空时不能删除,所以不要用库来临时隔离一次上传。
|
|
11296
|
+
*/
|
|
11297
|
+
export const registryRepositoriesCreate = (options) => (options.client ?? client).post({
|
|
11298
|
+
security: [{
|
|
11299
|
+
key: 'registry-bearerAuth',
|
|
11300
|
+
scheme: 'bearer',
|
|
11301
|
+
type: 'http'
|
|
11302
|
+
}],
|
|
11303
|
+
url: '/registry/v1/repositories',
|
|
11304
|
+
...options,
|
|
11305
|
+
headers: {
|
|
11306
|
+
'Content-Type': 'application/json',
|
|
11307
|
+
...options.headers
|
|
11308
|
+
}
|
|
11309
|
+
});
|
|
11310
|
+
/**
|
|
11311
|
+
* Delete repository
|
|
11312
|
+
*
|
|
11313
|
+
* 删一个空的库。默认库不能删(FAILED_PRECONDITION);库里还有包时也不能删,先把包删掉或改用别的库。删除请求重发会 404,所以删除前先读一次确认。
|
|
11314
|
+
*/
|
|
11315
|
+
export const registryRepositoriesDelete = (options) => (options.client ?? client).delete({
|
|
11316
|
+
security: [{
|
|
11317
|
+
key: 'registry-bearerAuth',
|
|
11318
|
+
scheme: 'bearer',
|
|
11319
|
+
type: 'http'
|
|
11320
|
+
}],
|
|
11321
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11322
|
+
...options
|
|
11323
|
+
});
|
|
11324
|
+
/**
|
|
11325
|
+
* Retrieve repository
|
|
11326
|
+
*
|
|
11327
|
+
* 读一个库的名称、说明、包数量和默认标记。repository_id 来自 repositories.list 或 repositories.create;另一个组织的库或不存在的库一律 404,不区分两者。
|
|
11328
|
+
*/
|
|
11329
|
+
export const registryRepositoriesRetrieve = (options) => (options.client ?? client).get({
|
|
11330
|
+
security: [{
|
|
11331
|
+
key: 'registry-bearerAuth',
|
|
11332
|
+
scheme: 'bearer',
|
|
11333
|
+
type: 'http'
|
|
11334
|
+
}],
|
|
11335
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11336
|
+
...options
|
|
11337
|
+
});
|
|
11338
|
+
/**
|
|
11339
|
+
* Update repository
|
|
11340
|
+
*
|
|
11341
|
+
* 改库的 display_name 或 description。只送要改的字段,省略的保持原值;name 建库之后不能改,它标识库。一个字段都不送会 400。
|
|
11342
|
+
*/
|
|
11343
|
+
export const registryRepositoriesUpdate = (options) => (options.client ?? client).patch({
|
|
11344
|
+
security: [{
|
|
11345
|
+
key: 'registry-bearerAuth',
|
|
11346
|
+
scheme: 'bearer',
|
|
11347
|
+
type: 'http'
|
|
11348
|
+
}],
|
|
11349
|
+
url: '/registry/v1/repositories/{repository_id}',
|
|
11350
|
+
...options,
|
|
11351
|
+
headers: {
|
|
11352
|
+
'Content-Type': 'application/json',
|
|
11353
|
+
...options.headers
|
|
11354
|
+
}
|
|
11355
|
+
});
|
|
11356
|
+
/**
|
|
11357
|
+
* List packages
|
|
11358
|
+
*
|
|
11359
|
+
* 列出一个库里的包,可按种类筛、按名字搜、按最近更新或下载量排序。kind=skill 只看技能,kind=plugin 只看插件,省略则两类都返回。q 在 name、title 和 description 上做子串匹配。sort 默认 updated;downloads 按累计下载量降序,用来找这个库最常用的资源。
|
|
11360
|
+
*/
|
|
11361
|
+
export const registryRepositoriesPackagesList = (options) => (options.client ?? client).get({
|
|
11362
|
+
security: [{
|
|
11363
|
+
key: 'registry-bearerAuth',
|
|
11364
|
+
scheme: 'bearer',
|
|
11365
|
+
type: 'http'
|
|
11366
|
+
}],
|
|
11367
|
+
url: '/registry/v1/repositories/{repository_id}/packages',
|
|
11368
|
+
...options
|
|
11369
|
+
});
|
|
11370
|
+
/**
|
|
11371
|
+
* Publish a package
|
|
11372
|
+
*
|
|
11373
|
+
* 把一个新包发布进这个库,一次调用建立包并上传它的第一个版本。发布内容是 multipart:version 必填,archive 给一个 zip,或者 files 给一组文件(每个文件的 filename 是相对上传根的路径,例如 pdf/SKILL.md)。单个顶层目录会被剥掉。种类按根上有什么判:有 SKILL.md 就是 skill,有 .claude-plugin/plugin.json 就是 plugin;两者都没有、或都有,会被拒。名字从 SKILL.md 或 plugin.json 里读,不从路径或 query 猜。限额:上传 ≤25 MiB,解压后 ≤50 MiB,≤1000 个文件。版本必须是 semver 且严格递增;第一个版本可以是任意合法 semver,之后每个新版本都要比已发布的最高版本高。把已有智能体的技能搬过来时,先用 GET /agent/v1/skills/{id}/versions/{v}/content 导出 zip,再在这里作为 archive 发布。
|
|
11374
|
+
*/
|
|
11375
|
+
export const registryRepositoriesPackagesCreate = (options) => (options.client ?? client).post({
|
|
11376
|
+
...formDataBodySerializer,
|
|
11377
|
+
security: [{
|
|
11378
|
+
key: 'registry-bearerAuth',
|
|
11379
|
+
scheme: 'bearer',
|
|
11380
|
+
type: 'http'
|
|
11381
|
+
}],
|
|
11382
|
+
url: '/registry/v1/repositories/{repository_id}/packages',
|
|
11383
|
+
...options,
|
|
11384
|
+
headers: {
|
|
11385
|
+
'Content-Type': null,
|
|
11386
|
+
...options.headers
|
|
11387
|
+
}
|
|
11388
|
+
});
|
|
11389
|
+
/**
|
|
11390
|
+
* Retrieve package
|
|
11391
|
+
*
|
|
11392
|
+
* 读一个包的元数据:种类、所属库、当前 latest_version、作者、标签和累计下载量。package_id 来自 packages.list 或 packages.create;另一个组织或不存在都返回 404。
|
|
11393
|
+
*/
|
|
11394
|
+
export const registryPackagesRetrieve = (options) => (options.client ?? client).get({
|
|
11395
|
+
security: [{
|
|
11396
|
+
key: 'registry-bearerAuth',
|
|
11397
|
+
scheme: 'bearer',
|
|
11398
|
+
type: 'http'
|
|
11399
|
+
}],
|
|
11400
|
+
url: '/registry/v1/packages/{package_id}',
|
|
11401
|
+
...options
|
|
11402
|
+
});
|
|
11403
|
+
/**
|
|
11404
|
+
* List versions
|
|
11405
|
+
*
|
|
11406
|
+
* 列出一个包的所有版本,含已撤回的。撤回的版本仍在列表里(它占着版本号),withdrawn 为 true,并带 withdraw_time。按发布顺序返回。
|
|
11407
|
+
*/
|
|
11408
|
+
export const registryPackagesVersionsList = (options) => (options.client ?? client).get({
|
|
11409
|
+
security: [{
|
|
11410
|
+
key: 'registry-bearerAuth',
|
|
11411
|
+
scheme: 'bearer',
|
|
11412
|
+
type: 'http'
|
|
11413
|
+
}],
|
|
11414
|
+
url: '/registry/v1/packages/{package_id}/versions',
|
|
11415
|
+
...options
|
|
11416
|
+
});
|
|
11417
|
+
/**
|
|
11418
|
+
* Publish a version
|
|
11419
|
+
*
|
|
11420
|
+
* 给一个已有的包发新版本。请求体与 packages.create 相同(multipart:version 必填,archive 或 files 给内容),但种类和名字沿用这个包,不再从上传内容重判。version 必须比已发布的最高版本高(撤回的版本也占号,不能复用);比它低或相等返回 FAILED_PRECONDITION。title、description、tags 不填就沿用这个包现在显示的,不会被新版本里 SKILL.md 或 plugin.json 的描述覆盖;要改就在这次请求里给。作者不随新版本改变。
|
|
11421
|
+
*/
|
|
11422
|
+
export const registryPackagesVersionsCreate = (options) => (options.client ?? client).post({
|
|
11423
|
+
...formDataBodySerializer,
|
|
11424
|
+
security: [{
|
|
11425
|
+
key: 'registry-bearerAuth',
|
|
11426
|
+
scheme: 'bearer',
|
|
11427
|
+
type: 'http'
|
|
11428
|
+
}],
|
|
11429
|
+
url: '/registry/v1/packages/{package_id}/versions',
|
|
11430
|
+
...options,
|
|
11431
|
+
headers: {
|
|
11432
|
+
'Content-Type': null,
|
|
11433
|
+
...options.headers
|
|
11434
|
+
}
|
|
11435
|
+
});
|
|
11436
|
+
/**
|
|
11437
|
+
* List version contents
|
|
11438
|
+
*
|
|
11439
|
+
* 列出一个版本解压后的文件清单(路径和大小),用来在不下载整个包的前提下看它包含什么。路径是相对包根的,例如 SKILL.md 或 plugin/skills/review.md。已撤回的版本仍可读清单。
|
|
11440
|
+
*/
|
|
11441
|
+
export const registryPackagesVersionsContents = (options) => (options.client ?? client).get({
|
|
11442
|
+
security: [{
|
|
11443
|
+
key: 'registry-bearerAuth',
|
|
11444
|
+
scheme: 'bearer',
|
|
11445
|
+
type: 'http'
|
|
11446
|
+
}],
|
|
11447
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/contents',
|
|
11448
|
+
...options
|
|
11449
|
+
});
|
|
11450
|
+
/**
|
|
11451
|
+
* Download a file
|
|
11452
|
+
*
|
|
11453
|
+
* 下载一个版本里的单个文件,返回原始字节。path 是 contents 给出的路径,可以含斜杠(例如 plugin/skills/review.md)。用它按文件取内容,装到磁盘上时保留这个相对路径。不计入 downloads。
|
|
11454
|
+
*/
|
|
11455
|
+
export const registryPackagesVersionsFilesRetrieve = (options) => (options.client ?? client).get({
|
|
11456
|
+
security: [{
|
|
11457
|
+
key: 'registry-bearerAuth',
|
|
11458
|
+
scheme: 'bearer',
|
|
11459
|
+
type: 'http'
|
|
11460
|
+
}],
|
|
11461
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/files/{path}',
|
|
11462
|
+
...options
|
|
11463
|
+
});
|
|
11464
|
+
/**
|
|
11465
|
+
* Download version archive
|
|
11466
|
+
*
|
|
11467
|
+
* 下载一个版本的完整 zip 归档,用来整包安装或转存。每次调用都计入这个包的 downloads,所以不要为了看内容而反复拉 archive——先读 contents,只取需要的文件用 files 下载。
|
|
11468
|
+
*/
|
|
11469
|
+
export const registryPackagesVersionsArchive = (options) => (options.client ?? client).get({
|
|
11470
|
+
security: [{
|
|
11471
|
+
key: 'registry-bearerAuth',
|
|
11472
|
+
scheme: 'bearer',
|
|
11473
|
+
type: 'http'
|
|
11474
|
+
}],
|
|
11475
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}/archive',
|
|
11476
|
+
...options
|
|
11477
|
+
});
|
|
11478
|
+
/**
|
|
11479
|
+
* Withdraw a version
|
|
11480
|
+
*
|
|
11481
|
+
* 撤回一个版本。撤回后它不再是 latest、不能被新装;已经装好的照常可用。版本号仍被占着,不能再用它发新版本。已经撤回的版本再撤回会返回 FAILED_PRECONDITION。撤回是不可逆的:要重新提供这个版本,用更高的版本号重新发布。
|
|
11482
|
+
*/
|
|
11483
|
+
export const registryPackagesVersionsWithdraw = (options) => (options.client ?? client).post({
|
|
11484
|
+
security: [{
|
|
11485
|
+
key: 'registry-bearerAuth',
|
|
11486
|
+
scheme: 'bearer',
|
|
11487
|
+
type: 'http'
|
|
11488
|
+
}],
|
|
11489
|
+
url: '/registry/v1/packages/{package_id}/versions/{version}:withdraw',
|
|
11490
|
+
...options
|
|
11491
|
+
});
|
|
11492
|
+
/**
|
|
11493
|
+
* List installations
|
|
11494
|
+
*
|
|
11495
|
+
* 列出这个包装在哪些智能体和电脑上。每次读取都会和目标那边对账,以目标现在的实际情况为准,所以每条记录的 state 是读取这一刻的结论:installed 表示目标上有它且版本与记录一致;drifted 表示目标上有它但版本不同,此时 version 显示目标上的版本;missing 表示目标上已经没有它(被人在智能体或电脑那边删掉了),记录仍保留,可以用 installations.delete 清掉,或用 installations.update 重新装回;unknown 表示这次问不到目标,不代表没装,稍后重读。withdrawn 表示这条记录的版本已被撤回。一次返回全部记录,没有分页,按创建时间排序。
|
|
11496
|
+
*/
|
|
11497
|
+
export const registryPackagesInstallationsList = (options) => (options.client ?? client).get({
|
|
11498
|
+
security: [{
|
|
11499
|
+
key: 'registry-bearerAuth',
|
|
11500
|
+
scheme: 'bearer',
|
|
11501
|
+
type: 'http'
|
|
11502
|
+
}],
|
|
11503
|
+
url: '/registry/v1/packages/{package_id}/installations',
|
|
11504
|
+
...options
|
|
11505
|
+
});
|
|
11506
|
+
/**
|
|
11507
|
+
* Install a package
|
|
11508
|
+
*
|
|
11509
|
+
* 把一个包装到目标上:技能装到智能体(agent_ids),插件装到电脑(computer_ids),一次最多 50 个目标;目标种类给错会被拒(400),包的种类可从 packages.retrieve 的 kind 得知。技能装的是具体版本,version 省略时装最新版,之后不会自动升级,要换版本用 installations.update。插件只能装库里的最新版本,version 若给了就必须等于最新版,否则 FAILED_PRECONDITION。撤回的版本不能新装。同一目标重复装同一个包不会报错,而是把它移到这个版本。技能被拒的情形:智能体上已有同名的另一个技能(名字冲突),或这个智能体已经有 20 个技能。各目标独立处理:只要有一个成功就返回 201,成功的在 data 里,失败的目标在 errors 里逐个列出 target_id、code 和 message,按消息修正后只对失败的目标重发;全部失败时不返回 201,而是按第一个失败返回错误状态。装到智能体或电脑上要求调用者本人有权限,权限不足会出现在该目标的 errors 里。
|
|
11510
|
+
*/
|
|
11511
|
+
export const registryPackagesInstallationsCreate = (options) => (options.client ?? client).post({
|
|
11512
|
+
security: [{
|
|
11513
|
+
key: 'registry-bearerAuth',
|
|
11514
|
+
scheme: 'bearer',
|
|
11515
|
+
type: 'http'
|
|
11516
|
+
}],
|
|
11517
|
+
url: '/registry/v1/packages/{package_id}/installations',
|
|
11518
|
+
...options,
|
|
11519
|
+
headers: {
|
|
11520
|
+
'Content-Type': 'application/json',
|
|
11521
|
+
...options.headers
|
|
11522
|
+
}
|
|
11523
|
+
});
|
|
11524
|
+
/**
|
|
11525
|
+
* Update an installation
|
|
11526
|
+
*
|
|
11527
|
+
* 把一条安装记录换到另一个版本。技能可以换到任何未撤回的版本(升级或回退),version 省略时换到最新版;插件只能换到库里的最新版本,version 给了也必须等于最新版。撤回的版本不能换过去。对账为 missing 的记录用它可以重新装回去。同名冲突和 20 个技能上限的规则与安装时相同。
|
|
11528
|
+
*/
|
|
11529
|
+
export const registryInstallationsUpdate = (options) => (options.client ?? client).post({
|
|
11530
|
+
security: [{
|
|
11531
|
+
key: 'registry-bearerAuth',
|
|
11532
|
+
scheme: 'bearer',
|
|
11533
|
+
type: 'http'
|
|
11534
|
+
}],
|
|
11535
|
+
url: '/registry/v1/installations/{installation_id}:update',
|
|
11536
|
+
...options,
|
|
11537
|
+
headers: {
|
|
11538
|
+
'Content-Type': 'application/json',
|
|
11539
|
+
...options.headers
|
|
11540
|
+
}
|
|
11541
|
+
});
|
|
11542
|
+
/**
|
|
11543
|
+
* Remove an installation
|
|
11544
|
+
*
|
|
11545
|
+
* 把包从目标上卸下来,并删掉这条安装记录:技能从智能体的技能列表里移除,插件从电脑上卸载。目标那边已经没有它时也算完成。包本身和它的版本不受影响,之后可以重新安装。记录删除后重发会 404,所以删除前先用 installations.list 确认。
|
|
11546
|
+
*/
|
|
11547
|
+
export const registryInstallationsDelete = (options) => (options.client ?? client).delete({
|
|
11548
|
+
security: [{
|
|
11549
|
+
key: 'registry-bearerAuth',
|
|
11550
|
+
scheme: 'bearer',
|
|
11551
|
+
type: 'http'
|
|
11552
|
+
}],
|
|
11553
|
+
url: '/registry/v1/installations/{installation_id}',
|
|
11554
|
+
...options
|
|
11555
|
+
});
|
|
11246
11556
|
/**
|
|
11247
11557
|
* List sandboxes (v2)
|
|
11248
11558
|
*
|