@rivet-dev/agentos-core 0.2.8-rc.1 → 0.2.8-rc.3
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/README.md +41 -38
- package/dist/agent-os.d.ts +189 -231
- package/dist/agent-os.js +756 -1162
- package/dist/agentos-package.d.ts +5 -3
- package/dist/agentos-package.js +5 -2
- package/dist/{host-tools-zod.d.ts → bindings-zod.d.ts} +1 -1
- package/dist/{host-tools-zod.js → bindings-zod.js} +27 -20
- package/dist/bindings.d.ts +43 -0
- package/dist/bindings.js +34 -0
- package/dist/cron/cron-manager.js +43 -10
- package/dist/cron/index.d.ts +1 -1
- package/dist/cron/types.d.ts +25 -9
- package/dist/filesystem-snapshot.d.ts +1 -2
- package/dist/filesystem-snapshot.js +0 -43
- package/dist/generated/AcpLimitsConfig.d.ts +16 -0
- package/dist/generated/BindingLimitsConfig.d.ts +10 -0
- package/dist/generated/CreateVmConfig.d.ts +2 -0
- package/dist/generated/ProcessLimitsConfig.d.ts +7 -0
- package/dist/generated/ProcessLimitsConfig.js +2 -0
- package/dist/generated/VmGroupConfig.d.ts +5 -0
- package/dist/generated/VmGroupConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +4 -2
- package/dist/generated/VmUserAccountConfig.d.ts +9 -0
- package/dist/generated/VmUserAccountConfig.js +2 -0
- package/dist/generated/VmUserConfig.d.ts +19 -0
- package/dist/generated/WasmLimitsConfig.d.ts +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -5
- package/dist/layers.d.ts +5 -2
- package/dist/layers.js +0 -185
- package/dist/options-schema.d.ts +133 -31
- package/dist/options-schema.js +143 -26
- package/dist/runtime-compat.d.ts +6 -35
- package/dist/runtime-compat.js +84 -372
- package/dist/runtime.d.ts +5 -1
- package/dist/sandbox.d.ts +4 -4
- package/dist/sandbox.js +4 -4
- package/dist/session-api.d.ts +180 -0
- package/dist/session-api.js +1 -0
- package/dist/sidecar/agentos-protocol.d.ts +429 -29
- package/dist/sidecar/agentos-protocol.js +691 -93
- package/dist/sidecar/rpc-client.d.ts +18 -6
- package/dist/sidecar/rpc-client.js +78 -31
- package/dist/test/runtime.d.ts +2 -1
- package/dist/test/runtime.js +2 -1
- package/dist/test/terminal-harness.js +0 -3
- package/dist/types.d.ts +4 -5
- package/package.json +21 -20
- package/dist/agent-session-types.d.ts +0 -67
- package/dist/generated/ToolLimitsConfig.d.ts +0 -10
- package/dist/host-tools.d.ts +0 -45
- package/dist/host-tools.js +0 -35
- package/dist/overlay-filesystem.d.ts +0 -19
- package/dist/overlay-filesystem.js +0 -645
- /package/dist/generated/{ToolLimitsConfig.js → BindingLimitsConfig.js} +0 -0
- /package/dist/{agent-session-types.js → generated/VmUserConfig.js} +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { ContentBlock, Implementation, McpServer, RequestPermissionRequest, RequestPermissionResponse, SessionConfigOption, SessionUpdate, StopReason } from "@agentclientprotocol/sdk";
|
|
2
|
+
export type { ContentBlock, McpServer, SessionConfigOption, SessionUpdate, StopReason, };
|
|
3
|
+
export type { RequestPermissionRequest, RequestPermissionResponse };
|
|
4
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export interface SerializedError {
|
|
8
|
+
code: string;
|
|
9
|
+
message: string;
|
|
10
|
+
details?: JsonValue;
|
|
11
|
+
retryable?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Exact upstream ACP MCP server configuration. */
|
|
14
|
+
export type McpServerConfig = McpServer;
|
|
15
|
+
export type PermissionPolicy = "reject_all" | "ask" | "allow_all";
|
|
16
|
+
export interface OpenSessionInput {
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
agent: string;
|
|
19
|
+
cwd?: string;
|
|
20
|
+
additionalDirectories?: string[];
|
|
21
|
+
env?: Record<string, string>;
|
|
22
|
+
mcpServers?: McpServerConfig[];
|
|
23
|
+
/**
|
|
24
|
+
* Immutable AgentOS strategy for native ACP permission requests. Defaults to
|
|
25
|
+
* `allow_all`. This does not configure VM permissions or adapter tool access.
|
|
26
|
+
*/
|
|
27
|
+
permissionPolicy?: PermissionPolicy;
|
|
28
|
+
skipOsInstructions?: boolean;
|
|
29
|
+
additionalInstructions?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SessionTarget {
|
|
32
|
+
sessionId?: string;
|
|
33
|
+
}
|
|
34
|
+
export type DeleteSessionInput = SessionTarget;
|
|
35
|
+
export type SessionState = {
|
|
36
|
+
status: "idle";
|
|
37
|
+
} | {
|
|
38
|
+
status: "running";
|
|
39
|
+
startedAt: string;
|
|
40
|
+
} | {
|
|
41
|
+
status: "waiting";
|
|
42
|
+
waitingSince: string;
|
|
43
|
+
requests: PendingPermissionRequest[];
|
|
44
|
+
} | {
|
|
45
|
+
status: "failed";
|
|
46
|
+
error: SerializedError;
|
|
47
|
+
};
|
|
48
|
+
export interface SessionInfo {
|
|
49
|
+
sessionId: string;
|
|
50
|
+
agent: string;
|
|
51
|
+
cwd: string;
|
|
52
|
+
additionalDirectories: string[];
|
|
53
|
+
state: SessionState;
|
|
54
|
+
latestSequence: number;
|
|
55
|
+
title?: string;
|
|
56
|
+
metadata?: Record<string, JsonValue> | null;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
updatedAt: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ListSessionsInput {
|
|
61
|
+
cursor?: string;
|
|
62
|
+
limit?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface SessionPage {
|
|
65
|
+
sessions: SessionInfo[];
|
|
66
|
+
nextCursor: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface PromptInput {
|
|
69
|
+
sessionId?: string;
|
|
70
|
+
idempotencyKey?: string;
|
|
71
|
+
content: ContentBlock[];
|
|
72
|
+
}
|
|
73
|
+
export interface UserMessage {
|
|
74
|
+
id: string;
|
|
75
|
+
role: "user";
|
|
76
|
+
content: ContentBlock[];
|
|
77
|
+
}
|
|
78
|
+
export interface AgentMessage {
|
|
79
|
+
id: string;
|
|
80
|
+
role: "agent";
|
|
81
|
+
content: ContentBlock[];
|
|
82
|
+
}
|
|
83
|
+
export interface PromptResult {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
message: AgentMessage | null;
|
|
86
|
+
stopReason: StopReason;
|
|
87
|
+
}
|
|
88
|
+
export interface CancelPromptResult {
|
|
89
|
+
status: "cancelled" | "no_active_prompt";
|
|
90
|
+
}
|
|
91
|
+
export interface DurableSessionEventEnvelope {
|
|
92
|
+
durability: "durable";
|
|
93
|
+
sessionId: string;
|
|
94
|
+
sequence: number;
|
|
95
|
+
timestamp: string;
|
|
96
|
+
}
|
|
97
|
+
export interface EphemeralSessionEventEnvelope {
|
|
98
|
+
durability: "ephemeral";
|
|
99
|
+
sessionId: string;
|
|
100
|
+
afterSequence: number;
|
|
101
|
+
}
|
|
102
|
+
type FlatAcpSessionUpdate<Update extends SessionUpdate = SessionUpdate> = Update extends SessionUpdate ? Omit<Update, "sessionUpdate"> & {
|
|
103
|
+
type: Update["sessionUpdate"];
|
|
104
|
+
} : never;
|
|
105
|
+
/** Exact ACP session-update payloads with the ACP discriminator promoted to `type`. */
|
|
106
|
+
export type AcpSessionEvent = FlatAcpSessionUpdate;
|
|
107
|
+
export type DurableSessionUpdateEntry = DurableSessionEventEnvelope & AcpSessionEvent;
|
|
108
|
+
export type DurablePermissionRequestEntry = DurableSessionEventEnvelope & {
|
|
109
|
+
type: "permission_request";
|
|
110
|
+
requestId: string;
|
|
111
|
+
} & Omit<RequestPermissionRequest, "sessionId">;
|
|
112
|
+
export type DurablePermissionResponseEntry = DurableSessionEventEnvelope & {
|
|
113
|
+
type: "permission_response";
|
|
114
|
+
requestId: string;
|
|
115
|
+
status: "accepted" | "not_pending";
|
|
116
|
+
reason?: PermissionTerminalReason;
|
|
117
|
+
} & RequestPermissionResponse;
|
|
118
|
+
export type DurableSessionEventEntry = DurableSessionUpdateEntry | DurablePermissionRequestEntry | DurablePermissionResponseEntry;
|
|
119
|
+
export type EphemeralSessionEventEntry = EphemeralSessionEventEnvelope & FlatAcpSessionUpdate<Extract<SessionUpdate, {
|
|
120
|
+
sessionUpdate: "agent_message_chunk" | "agent_thought_chunk";
|
|
121
|
+
}>>;
|
|
122
|
+
export type SessionStreamEntry = DurableSessionEventEntry | EphemeralSessionEventEntry;
|
|
123
|
+
export interface ReadHistoryInput extends SessionTarget {
|
|
124
|
+
before?: number;
|
|
125
|
+
after?: number;
|
|
126
|
+
limit?: number;
|
|
127
|
+
}
|
|
128
|
+
export interface HistoryPage {
|
|
129
|
+
events: DurableSessionEventEntry[];
|
|
130
|
+
hasMoreBefore: boolean;
|
|
131
|
+
hasMoreAfter: boolean;
|
|
132
|
+
}
|
|
133
|
+
export interface SessionConfig {
|
|
134
|
+
revision: number;
|
|
135
|
+
options: SessionConfigOption[];
|
|
136
|
+
}
|
|
137
|
+
export interface SetSessionConfigOptionInput extends SessionTarget {
|
|
138
|
+
configId: string;
|
|
139
|
+
value: string | boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface SessionCapabilities {
|
|
142
|
+
protocolVersion: number;
|
|
143
|
+
loadSession: boolean;
|
|
144
|
+
prompt?: {
|
|
145
|
+
audio?: boolean;
|
|
146
|
+
embeddedContext?: boolean;
|
|
147
|
+
image?: boolean;
|
|
148
|
+
};
|
|
149
|
+
mcp?: {
|
|
150
|
+
http?: boolean;
|
|
151
|
+
sse?: boolean;
|
|
152
|
+
};
|
|
153
|
+
session?: {
|
|
154
|
+
list?: boolean;
|
|
155
|
+
resume?: boolean;
|
|
156
|
+
close?: boolean;
|
|
157
|
+
delete?: boolean;
|
|
158
|
+
additionalDirectories?: boolean;
|
|
159
|
+
};
|
|
160
|
+
extensions?: Record<string, JsonValue>;
|
|
161
|
+
}
|
|
162
|
+
export type SessionAgentInfo = Implementation;
|
|
163
|
+
export interface PendingPermissionRequest {
|
|
164
|
+
requestId: string;
|
|
165
|
+
options: RequestPermissionRequest["options"];
|
|
166
|
+
toolCall: RequestPermissionRequest["toolCall"];
|
|
167
|
+
_meta?: RequestPermissionRequest["_meta"];
|
|
168
|
+
}
|
|
169
|
+
export interface PermissionResponse {
|
|
170
|
+
sessionId: string;
|
|
171
|
+
requestId: string;
|
|
172
|
+
optionId: string;
|
|
173
|
+
}
|
|
174
|
+
export type PermissionTerminalReason = "already_resolved" | "prompt_cancelled" | "adapter_exited" | "session_deleted" | "vm_shutdown" | "request_not_found";
|
|
175
|
+
export type PermissionResponseResult = {
|
|
176
|
+
status: "accepted";
|
|
177
|
+
} | {
|
|
178
|
+
status: "not_pending";
|
|
179
|
+
reason: PermissionTerminalReason;
|
|
180
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|