@alan-ai-hq/agent-manager-linux-arm64 0.1.188 → 0.1.190
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/alan-agent.cjs +14834 -14413
- package/alan-holder.cjs +7708 -7355
- package/alan-lease.cjs +264 -240
- package/package.json +1 -1
package/alan-lease.cjs
CHANGED
|
@@ -21093,6 +21093,252 @@ var init_agent_context = __esm({
|
|
|
21093
21093
|
}
|
|
21094
21094
|
});
|
|
21095
21095
|
|
|
21096
|
+
// ../shared/src/runtime-v2/machine-identity.ts
|
|
21097
|
+
var machineEndpointsSchema, machineCredentialGrantSchema, MACHINE_PATHS, machinePlatformSchema, machineRegisterRequestSchema, machineEnrollRequestSchema, machineRenewRequestSchema, machineRenewReusedSchema, deviceAuthorizationSchema, machineDeviceAuthorizationRequestSchema, machineDeviceTokenRequestSchema, machineDeviceTokenSchema, DEVICE_TOKEN_ERRORS, machineDeviceTokenErrorSchema, machineMcpCredentialRequestSchema, machineMcpCredentialSchema, runtimeReleaseSchema, machineSiblingSchema, MACHINE_SIBLINGS_LIMIT, machineSiblingsResponseSchema, runCodexCredentialSchema, runCodexCredentialRefreshRequestSchema, runProviderCredentialSchema;
|
|
21098
|
+
var init_machine_identity = __esm({
|
|
21099
|
+
"../shared/src/runtime-v2/machine-identity.ts"() {
|
|
21100
|
+
"use strict";
|
|
21101
|
+
init_zod();
|
|
21102
|
+
init_ids();
|
|
21103
|
+
machineEndpointsSchema = external_exports.object({
|
|
21104
|
+
apiUrl: external_exports.url(),
|
|
21105
|
+
wsUrl: external_exports.url()
|
|
21106
|
+
});
|
|
21107
|
+
machineCredentialGrantSchema = external_exports.object({
|
|
21108
|
+
machineId: machineIdSchema,
|
|
21109
|
+
accessToken: external_exports.string().min(1),
|
|
21110
|
+
accessTokenExpiresAt: external_exports.iso.datetime(),
|
|
21111
|
+
renewalToken: external_exports.string().min(1),
|
|
21112
|
+
endpoints: machineEndpointsSchema
|
|
21113
|
+
});
|
|
21114
|
+
MACHINE_PATHS = {
|
|
21115
|
+
/** POST with a one-time setup grant (what `install --setup-token` / `setup` send). */
|
|
21116
|
+
register: "/public/machines/register",
|
|
21117
|
+
/** POST with a cloud sandbox's one-time enrollment code from `ALAN_RUNTIME_ENROLLMENT_CODE`. */
|
|
21118
|
+
enroll: "/public/machines/enroll",
|
|
21119
|
+
// quirk: POST with the current renewal token; the response carries a new one and the previous one dies.
|
|
21120
|
+
renew: "/public/machines/me/renew",
|
|
21121
|
+
/** POST by the machine itself on logout/uninstall. */
|
|
21122
|
+
revokeSelf: "/public/machines/me/revoke",
|
|
21123
|
+
/** POST by a session holder: an MCP-only credential bound to one conversation. */
|
|
21124
|
+
mcpCredential: "/public/machines/me/mcp-credential",
|
|
21125
|
+
/** POST by the runtime for git's credential helper: a short capability for one repository. */
|
|
21126
|
+
gitCapability: "/public/machines/me/git/capability",
|
|
21127
|
+
/** Any method, by the runtime for `gh`: the GitHub API behind Alan's policy (`github-proxy.ts`). */
|
|
21128
|
+
githubProxy: "/public/machines/me/github",
|
|
21129
|
+
/**
|
|
21130
|
+
* Device-code setup for a terminal with no browser session (`alan-agent setup --device`,
|
|
21131
|
+
* RFC 8628). The user approves on the web page the v1 flow uses; the token route then
|
|
21132
|
+
* hands out a one-time setup grant for `register`.
|
|
21133
|
+
*/
|
|
21134
|
+
deviceAuthorization: "/public/machines/device-authorizations",
|
|
21135
|
+
deviceToken: "/public/machines/device-authorizations/token",
|
|
21136
|
+
/** What version this environment wants machines on; the shape of this path never changes. */
|
|
21137
|
+
currentRelease: "/public/runtime/releases/v1/current",
|
|
21138
|
+
/** GET by `doctor`: the calling machine and its owner's other machines. */
|
|
21139
|
+
siblings: "/public/machines/me/siblings"
|
|
21140
|
+
};
|
|
21141
|
+
machinePlatformSchema = external_exports.object({
|
|
21142
|
+
os: external_exports.enum(["darwin", "linux", "win32"]),
|
|
21143
|
+
arch: external_exports.string().min(1),
|
|
21144
|
+
hostname: external_exports.string().min(1),
|
|
21145
|
+
runtimeVersion: external_exports.string().min(1)
|
|
21146
|
+
});
|
|
21147
|
+
machineRegisterRequestSchema = external_exports.object({
|
|
21148
|
+
setupToken: external_exports.string().min(1),
|
|
21149
|
+
platform: machinePlatformSchema,
|
|
21150
|
+
/** Present when re-registering the same install, so the server can reuse the machine row. */
|
|
21151
|
+
machineId: machineIdSchema.optional(),
|
|
21152
|
+
/** Chosen by the install before its first registration, so a credential lost locally still maps to its row. */
|
|
21153
|
+
installationId: external_exports.guid().optional()
|
|
21154
|
+
});
|
|
21155
|
+
machineEnrollRequestSchema = external_exports.object({ enrollmentCode: external_exports.string().min(1) });
|
|
21156
|
+
machineRenewRequestSchema = external_exports.object({ renewalToken: external_exports.string().min(1) });
|
|
21157
|
+
machineRenewReusedSchema = external_exports.object({
|
|
21158
|
+
error: external_exports.literal("renewal_token_reused"),
|
|
21159
|
+
message: external_exports.string()
|
|
21160
|
+
});
|
|
21161
|
+
deviceAuthorizationSchema = external_exports.object({
|
|
21162
|
+
deviceCode: external_exports.string().min(1),
|
|
21163
|
+
userCode: external_exports.string().min(1),
|
|
21164
|
+
verificationUri: external_exports.url(),
|
|
21165
|
+
intervalSeconds: external_exports.number().int().positive(),
|
|
21166
|
+
expiresInSeconds: external_exports.number().int().positive()
|
|
21167
|
+
});
|
|
21168
|
+
machineDeviceAuthorizationRequestSchema = external_exports.object({
|
|
21169
|
+
platform: machinePlatformSchema,
|
|
21170
|
+
/** Register into this team; the approving user must have access to it in their organization. */
|
|
21171
|
+
teamId: external_exports.guid().optional()
|
|
21172
|
+
});
|
|
21173
|
+
machineDeviceTokenRequestSchema = external_exports.object({ deviceCode: external_exports.string().min(1) });
|
|
21174
|
+
machineDeviceTokenSchema = external_exports.object({ setupToken: external_exports.string().min(1) });
|
|
21175
|
+
DEVICE_TOKEN_ERRORS = [
|
|
21176
|
+
"authorization_pending",
|
|
21177
|
+
"slow_down",
|
|
21178
|
+
"expired_token",
|
|
21179
|
+
"access_denied",
|
|
21180
|
+
"invalid_grant"
|
|
21181
|
+
];
|
|
21182
|
+
machineDeviceTokenErrorSchema = external_exports.object({ error: external_exports.enum(DEVICE_TOKEN_ERRORS) });
|
|
21183
|
+
machineMcpCredentialRequestSchema = external_exports.object({ conversationId: conversationIdSchema });
|
|
21184
|
+
machineMcpCredentialSchema = external_exports.object({
|
|
21185
|
+
authorization: external_exports.string().startsWith("Bearer "),
|
|
21186
|
+
expiresAt: external_exports.iso.datetime()
|
|
21187
|
+
});
|
|
21188
|
+
runtimeReleaseSchema = external_exports.object({
|
|
21189
|
+
/** npm version of the platform packages; machines trust the tarball by the registry's integrity. */
|
|
21190
|
+
version: external_exports.string().min(1),
|
|
21191
|
+
/** Machines below this refuse no work but are told to upgrade; below `minimumVersion` they are refused. */
|
|
21192
|
+
minimumVersion: external_exports.string().min(1),
|
|
21193
|
+
/** Staged rollout: the share of machines (0\u2013100) that should take this version now. */
|
|
21194
|
+
rolloutPercent: external_exports.number().int().min(0).max(100)
|
|
21195
|
+
});
|
|
21196
|
+
machineSiblingSchema = external_exports.object({
|
|
21197
|
+
machineId: machineIdSchema,
|
|
21198
|
+
name: external_exports.string(),
|
|
21199
|
+
hostname: external_exports.string().nullable(),
|
|
21200
|
+
os: external_exports.string().nullable(),
|
|
21201
|
+
protocol: external_exports.number().int().nullable(),
|
|
21202
|
+
online: external_exports.boolean(),
|
|
21203
|
+
lastSeenAt: external_exports.iso.datetime().nullable(),
|
|
21204
|
+
current: external_exports.boolean(),
|
|
21205
|
+
/** Registered from the same install (`installationId`) as the caller. */
|
|
21206
|
+
sameInstallation: external_exports.boolean()
|
|
21207
|
+
});
|
|
21208
|
+
MACHINE_SIBLINGS_LIMIT = 200;
|
|
21209
|
+
machineSiblingsResponseSchema = external_exports.object({
|
|
21210
|
+
machines: external_exports.array(machineSiblingSchema).max(MACHINE_SIBLINGS_LIMIT)
|
|
21211
|
+
});
|
|
21212
|
+
runCodexCredentialSchema = external_exports.object({
|
|
21213
|
+
accessToken: external_exports.string().min(1),
|
|
21214
|
+
chatgptAccountId: external_exports.string().min(1),
|
|
21215
|
+
chatgptPlanType: external_exports.string().nullable(),
|
|
21216
|
+
credentialId: external_exports.uuid().optional(),
|
|
21217
|
+
providerUserId: external_exports.string().min(1).optional()
|
|
21218
|
+
});
|
|
21219
|
+
runCodexCredentialRefreshRequestSchema = external_exports.object({
|
|
21220
|
+
/** sha256 hex of the access token Codex was refused with; a newer stored token is returned instead of rotating. */
|
|
21221
|
+
rejectedAccessTokenSha256: external_exports.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
21222
|
+
});
|
|
21223
|
+
runProviderCredentialSchema = external_exports.object({
|
|
21224
|
+
/** Environment variables for the agent CLI, e.g. ANTHROPIC_API_KEY; empty when the CLI's own login is used. */
|
|
21225
|
+
env: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21226
|
+
/** The bound Codex login for a cloud sandbox; absent where the CLI's own login is used. */
|
|
21227
|
+
codex: runCodexCredentialSchema.optional()
|
|
21228
|
+
});
|
|
21229
|
+
}
|
|
21230
|
+
});
|
|
21231
|
+
|
|
21232
|
+
// ../shared/src/runtime-v2/query-result.ts
|
|
21233
|
+
function queryResultSchema(value) {
|
|
21234
|
+
return external_exports.discriminatedUnion("ok", [
|
|
21235
|
+
external_exports.object({ ok: external_exports.literal(true), value }),
|
|
21236
|
+
external_exports.object({ ok: external_exports.literal(false), error: queryErrorSchema })
|
|
21237
|
+
]);
|
|
21238
|
+
}
|
|
21239
|
+
var queryErrorSchema;
|
|
21240
|
+
var init_query_result = __esm({
|
|
21241
|
+
"../shared/src/runtime-v2/query-result.ts"() {
|
|
21242
|
+
"use strict";
|
|
21243
|
+
init_zod();
|
|
21244
|
+
queryErrorSchema = external_exports.object({
|
|
21245
|
+
code: external_exports.string().min(1),
|
|
21246
|
+
message: external_exports.string()
|
|
21247
|
+
});
|
|
21248
|
+
}
|
|
21249
|
+
});
|
|
21250
|
+
|
|
21251
|
+
// ../shared/src/runtime-v2/capabilities.ts
|
|
21252
|
+
var PROVIDER_MODELS_MAX, providerAuthStateSchema, PROVIDER_MODEL_VARIANTS_MAX, providerModelVariantSchema, providerModelBillingSchema, providerModelSchema, providerModelsSourceSchema, providerCapabilitySchema, machineFactsSchema, machineCapabilitiesSchema, modelsScanRequestSchema, modelsScanResultSchema, capabilitiesAckSchema;
|
|
21253
|
+
var init_capabilities = __esm({
|
|
21254
|
+
"../shared/src/runtime-v2/capabilities.ts"() {
|
|
21255
|
+
"use strict";
|
|
21256
|
+
init_zod();
|
|
21257
|
+
init_machine_identity();
|
|
21258
|
+
init_query_result();
|
|
21259
|
+
PROVIDER_MODELS_MAX = 2e3;
|
|
21260
|
+
providerAuthStateSchema = external_exports.enum(["signed_in", "signed_out", "unknown"]);
|
|
21261
|
+
PROVIDER_MODEL_VARIANTS_MAX = 32;
|
|
21262
|
+
providerModelVariantSchema = external_exports.string().min(1).max(64).regex(/^[^\s\p{Cc}]+$/u);
|
|
21263
|
+
providerModelBillingSchema = external_exports.enum(["free", "paid"]);
|
|
21264
|
+
providerModelSchema = external_exports.object({
|
|
21265
|
+
id: external_exports.string().min(1).max(200),
|
|
21266
|
+
label: external_exports.string().min(1).max(200).optional(),
|
|
21267
|
+
/** The CLI's reasoning variants in its own order; empty when it says the model has none. */
|
|
21268
|
+
variants: external_exports.array(providerModelVariantSchema).max(PROVIDER_MODEL_VARIANTS_MAX).optional(),
|
|
21269
|
+
billing: providerModelBillingSchema.optional()
|
|
21270
|
+
});
|
|
21271
|
+
providerModelsSourceSchema = external_exports.enum(["discovered", "catalog"]);
|
|
21272
|
+
providerCapabilitySchema = external_exports.object({
|
|
21273
|
+
backendKind: external_exports.string().min(1).max(64),
|
|
21274
|
+
installed: external_exports.boolean(),
|
|
21275
|
+
version: external_exports.string().min(1).max(200).optional(),
|
|
21276
|
+
auth: providerAuthStateSchema,
|
|
21277
|
+
/** What the user has to do when `auth` is `signed_out`, e.g. the login command. */
|
|
21278
|
+
authMessage: external_exports.string().min(1).max(1e3).optional(),
|
|
21279
|
+
/** Provider-reported account tier or API-key mode; never inferred from executable presence. */
|
|
21280
|
+
authLabel: external_exports.string().min(1).max(100).optional(),
|
|
21281
|
+
/** Whether `--version` ran. Absent: not probed; a label, never a reason to hide the provider. */
|
|
21282
|
+
runStatus: external_exports.enum(["ready", "cannot_start"]).optional(),
|
|
21283
|
+
/** The CLI's own first line when it could not start. */
|
|
21284
|
+
runMessage: external_exports.string().min(1).max(1e3).optional(),
|
|
21285
|
+
/** Absent: the CLI has no model list the runtime can read; the server keeps its catalog. */
|
|
21286
|
+
models: external_exports.array(providerModelSchema).max(PROVIDER_MODELS_MAX).optional(),
|
|
21287
|
+
/** Present with `models`. */
|
|
21288
|
+
modelsSource: providerModelsSourceSchema.optional(),
|
|
21289
|
+
/** Ids the CLI itself marks deprecated; never in `models`. Absence is not a deprecation. */
|
|
21290
|
+
deprecatedModels: external_exports.array(external_exports.string().min(1).max(200)).max(PROVIDER_MODELS_MAX).optional(),
|
|
21291
|
+
/** The runtime can hand a mid-run message to the running turn. Absent: it cannot. */
|
|
21292
|
+
steer: external_exports.boolean().optional(),
|
|
21293
|
+
checkedAt: external_exports.number().int().nonnegative()
|
|
21294
|
+
});
|
|
21295
|
+
machineFactsSchema = machinePlatformSchema.extend({
|
|
21296
|
+
osRelease: external_exports.string().min(1).max(200),
|
|
21297
|
+
cpuCount: external_exports.number().int().nonnegative(),
|
|
21298
|
+
totalMemoryBytes: external_exports.number().int().nonnegative()
|
|
21299
|
+
});
|
|
21300
|
+
machineCapabilitiesSchema = external_exports.object({
|
|
21301
|
+
providers: external_exports.array(providerCapabilitySchema).max(64),
|
|
21302
|
+
hasGit: external_exports.boolean(),
|
|
21303
|
+
/**
|
|
21304
|
+
* The runtime answers `files.*` workspace queries and pushes `workspace.changed`. Absent: an
|
|
21305
|
+
* older runtime; the server lists and reads files through the sandbox provider instead.
|
|
21306
|
+
*/
|
|
21307
|
+
workspaceFiles: external_exports.boolean().optional(),
|
|
21308
|
+
machine: machineFactsSchema,
|
|
21309
|
+
scannedAt: external_exports.number().int().nonnegative()
|
|
21310
|
+
});
|
|
21311
|
+
modelsScanRequestSchema = external_exports.object({ refresh: external_exports.boolean().optional() });
|
|
21312
|
+
modelsScanResultSchema = queryResultSchema(machineCapabilitiesSchema);
|
|
21313
|
+
capabilitiesAckSchema = external_exports.object({ stored: external_exports.boolean() });
|
|
21314
|
+
}
|
|
21315
|
+
});
|
|
21316
|
+
|
|
21317
|
+
// ../shared/src/validators/attachments.ts
|
|
21318
|
+
var MAX_COMMENT_ATTACHMENTS, requestPresignedUploadSchema, linkAttachmentSchema, renameAttachmentSchema;
|
|
21319
|
+
var init_attachments = __esm({
|
|
21320
|
+
"../shared/src/validators/attachments.ts"() {
|
|
21321
|
+
"use strict";
|
|
21322
|
+
init_zod();
|
|
21323
|
+
MAX_COMMENT_ATTACHMENTS = 10;
|
|
21324
|
+
requestPresignedUploadSchema = external_exports.object({
|
|
21325
|
+
filename: external_exports.string().min(1).max(500),
|
|
21326
|
+
mimeType: external_exports.string().min(1).max(200),
|
|
21327
|
+
size: external_exports.number().int().positive().max(50 * 1024 * 1024),
|
|
21328
|
+
// 50MB max
|
|
21329
|
+
entityType: external_exports.string().min(1).max(50),
|
|
21330
|
+
entityId: external_exports.uuid().optional()
|
|
21331
|
+
});
|
|
21332
|
+
linkAttachmentSchema = external_exports.object({
|
|
21333
|
+
entityType: external_exports.string().min(1).max(50),
|
|
21334
|
+
entityId: external_exports.uuid()
|
|
21335
|
+
});
|
|
21336
|
+
renameAttachmentSchema = external_exports.object({
|
|
21337
|
+
displayName: external_exports.string().trim().min(1).max(500)
|
|
21338
|
+
});
|
|
21339
|
+
}
|
|
21340
|
+
});
|
|
21341
|
+
|
|
21096
21342
|
// ../shared/src/session-owned-execution.ts
|
|
21097
21343
|
var EXECUTION_OWNERS;
|
|
21098
21344
|
var init_session_owned_execution = __esm({
|
|
@@ -21829,150 +22075,8 @@ var init_desired_state = __esm({
|
|
|
21829
22075
|
}
|
|
21830
22076
|
});
|
|
21831
22077
|
|
|
21832
|
-
// ../shared/src/runtime-v2/machine-identity.ts
|
|
21833
|
-
var machineEndpointsSchema, machineCredentialGrantSchema, MACHINE_PATHS, machinePlatformSchema, machineRegisterRequestSchema, machineEnrollRequestSchema, machineRenewRequestSchema, machineRenewReusedSchema, deviceAuthorizationSchema, machineDeviceAuthorizationRequestSchema, machineDeviceTokenRequestSchema, machineDeviceTokenSchema, DEVICE_TOKEN_ERRORS, machineDeviceTokenErrorSchema, machineMcpCredentialRequestSchema, machineMcpCredentialSchema, runtimeReleaseSchema, machineSiblingSchema, MACHINE_SIBLINGS_LIMIT, machineSiblingsResponseSchema, runCodexCredentialSchema, runCodexCredentialRefreshRequestSchema, runProviderCredentialSchema;
|
|
21834
|
-
var init_machine_identity = __esm({
|
|
21835
|
-
"../shared/src/runtime-v2/machine-identity.ts"() {
|
|
21836
|
-
"use strict";
|
|
21837
|
-
init_zod();
|
|
21838
|
-
init_ids();
|
|
21839
|
-
machineEndpointsSchema = external_exports.object({
|
|
21840
|
-
apiUrl: external_exports.url(),
|
|
21841
|
-
wsUrl: external_exports.url()
|
|
21842
|
-
});
|
|
21843
|
-
machineCredentialGrantSchema = external_exports.object({
|
|
21844
|
-
machineId: machineIdSchema,
|
|
21845
|
-
accessToken: external_exports.string().min(1),
|
|
21846
|
-
accessTokenExpiresAt: external_exports.iso.datetime(),
|
|
21847
|
-
renewalToken: external_exports.string().min(1),
|
|
21848
|
-
endpoints: machineEndpointsSchema
|
|
21849
|
-
});
|
|
21850
|
-
MACHINE_PATHS = {
|
|
21851
|
-
/** POST with a one-time setup grant (what `install --setup-token` / `setup` send). */
|
|
21852
|
-
register: "/public/machines/register",
|
|
21853
|
-
/** POST with a cloud sandbox's one-time enrollment code from `ALAN_RUNTIME_ENROLLMENT_CODE`. */
|
|
21854
|
-
enroll: "/public/machines/enroll",
|
|
21855
|
-
// quirk: POST with the current renewal token; the response carries a new one and the previous one dies.
|
|
21856
|
-
renew: "/public/machines/me/renew",
|
|
21857
|
-
/** POST by the machine itself on logout/uninstall. */
|
|
21858
|
-
revokeSelf: "/public/machines/me/revoke",
|
|
21859
|
-
/** POST by a session holder: an MCP-only credential bound to one conversation. */
|
|
21860
|
-
mcpCredential: "/public/machines/me/mcp-credential",
|
|
21861
|
-
/** POST by the runtime for git's credential helper: a short capability for one repository. */
|
|
21862
|
-
gitCapability: "/public/machines/me/git/capability",
|
|
21863
|
-
/** Any method, by the runtime for `gh`: the GitHub API behind Alan's policy (`github-proxy.ts`). */
|
|
21864
|
-
githubProxy: "/public/machines/me/github",
|
|
21865
|
-
/**
|
|
21866
|
-
* Device-code setup for a terminal with no browser session (`alan-agent setup --device`,
|
|
21867
|
-
* RFC 8628). The user approves on the web page the v1 flow uses; the token route then
|
|
21868
|
-
* hands out a one-time setup grant for `register`.
|
|
21869
|
-
*/
|
|
21870
|
-
deviceAuthorization: "/public/machines/device-authorizations",
|
|
21871
|
-
deviceToken: "/public/machines/device-authorizations/token",
|
|
21872
|
-
/** What version this environment wants machines on; the shape of this path never changes. */
|
|
21873
|
-
currentRelease: "/public/runtime/releases/v1/current",
|
|
21874
|
-
/** GET by `doctor`: the calling machine and its owner's other machines. */
|
|
21875
|
-
siblings: "/public/machines/me/siblings"
|
|
21876
|
-
};
|
|
21877
|
-
machinePlatformSchema = external_exports.object({
|
|
21878
|
-
os: external_exports.enum(["darwin", "linux", "win32"]),
|
|
21879
|
-
arch: external_exports.string().min(1),
|
|
21880
|
-
hostname: external_exports.string().min(1),
|
|
21881
|
-
runtimeVersion: external_exports.string().min(1)
|
|
21882
|
-
});
|
|
21883
|
-
machineRegisterRequestSchema = external_exports.object({
|
|
21884
|
-
setupToken: external_exports.string().min(1),
|
|
21885
|
-
platform: machinePlatformSchema,
|
|
21886
|
-
/** Present when re-registering the same install, so the server can reuse the machine row. */
|
|
21887
|
-
machineId: machineIdSchema.optional(),
|
|
21888
|
-
/** Chosen by the install before its first registration, so a credential lost locally still maps to its row. */
|
|
21889
|
-
installationId: external_exports.guid().optional()
|
|
21890
|
-
});
|
|
21891
|
-
machineEnrollRequestSchema = external_exports.object({ enrollmentCode: external_exports.string().min(1) });
|
|
21892
|
-
machineRenewRequestSchema = external_exports.object({ renewalToken: external_exports.string().min(1) });
|
|
21893
|
-
machineRenewReusedSchema = external_exports.object({
|
|
21894
|
-
error: external_exports.literal("renewal_token_reused"),
|
|
21895
|
-
message: external_exports.string()
|
|
21896
|
-
});
|
|
21897
|
-
deviceAuthorizationSchema = external_exports.object({
|
|
21898
|
-
deviceCode: external_exports.string().min(1),
|
|
21899
|
-
userCode: external_exports.string().min(1),
|
|
21900
|
-
verificationUri: external_exports.url(),
|
|
21901
|
-
intervalSeconds: external_exports.number().int().positive(),
|
|
21902
|
-
expiresInSeconds: external_exports.number().int().positive()
|
|
21903
|
-
});
|
|
21904
|
-
machineDeviceAuthorizationRequestSchema = external_exports.object({
|
|
21905
|
-
platform: machinePlatformSchema,
|
|
21906
|
-
/** Register into this team; the approving user must have access to it in their organization. */
|
|
21907
|
-
teamId: external_exports.guid().optional()
|
|
21908
|
-
});
|
|
21909
|
-
machineDeviceTokenRequestSchema = external_exports.object({ deviceCode: external_exports.string().min(1) });
|
|
21910
|
-
machineDeviceTokenSchema = external_exports.object({ setupToken: external_exports.string().min(1) });
|
|
21911
|
-
DEVICE_TOKEN_ERRORS = [
|
|
21912
|
-
"authorization_pending",
|
|
21913
|
-
"slow_down",
|
|
21914
|
-
"expired_token",
|
|
21915
|
-
"access_denied",
|
|
21916
|
-
"invalid_grant"
|
|
21917
|
-
];
|
|
21918
|
-
machineDeviceTokenErrorSchema = external_exports.object({ error: external_exports.enum(DEVICE_TOKEN_ERRORS) });
|
|
21919
|
-
machineMcpCredentialRequestSchema = external_exports.object({ conversationId: conversationIdSchema });
|
|
21920
|
-
machineMcpCredentialSchema = external_exports.object({
|
|
21921
|
-
authorization: external_exports.string().startsWith("Bearer "),
|
|
21922
|
-
expiresAt: external_exports.iso.datetime()
|
|
21923
|
-
});
|
|
21924
|
-
runtimeReleaseSchema = external_exports.object({
|
|
21925
|
-
/** npm version of the platform packages; machines trust the tarball by the registry's integrity. */
|
|
21926
|
-
version: external_exports.string().min(1),
|
|
21927
|
-
/** Machines below this refuse no work but are told to upgrade; below `minimumVersion` they are refused. */
|
|
21928
|
-
minimumVersion: external_exports.string().min(1),
|
|
21929
|
-
/** Staged rollout: the share of machines (0\u2013100) that should take this version now. */
|
|
21930
|
-
rolloutPercent: external_exports.number().int().min(0).max(100)
|
|
21931
|
-
});
|
|
21932
|
-
machineSiblingSchema = external_exports.object({
|
|
21933
|
-
machineId: machineIdSchema,
|
|
21934
|
-
name: external_exports.string(),
|
|
21935
|
-
hostname: external_exports.string().nullable(),
|
|
21936
|
-
os: external_exports.string().nullable(),
|
|
21937
|
-
protocol: external_exports.number().int().nullable(),
|
|
21938
|
-
online: external_exports.boolean(),
|
|
21939
|
-
lastSeenAt: external_exports.iso.datetime().nullable(),
|
|
21940
|
-
current: external_exports.boolean(),
|
|
21941
|
-
/** Registered from the same install (`installationId`) as the caller. */
|
|
21942
|
-
sameInstallation: external_exports.boolean()
|
|
21943
|
-
});
|
|
21944
|
-
MACHINE_SIBLINGS_LIMIT = 200;
|
|
21945
|
-
machineSiblingsResponseSchema = external_exports.object({
|
|
21946
|
-
machines: external_exports.array(machineSiblingSchema).max(MACHINE_SIBLINGS_LIMIT)
|
|
21947
|
-
});
|
|
21948
|
-
runCodexCredentialSchema = external_exports.object({
|
|
21949
|
-
accessToken: external_exports.string().min(1),
|
|
21950
|
-
chatgptAccountId: external_exports.string().min(1),
|
|
21951
|
-
chatgptPlanType: external_exports.string().nullable(),
|
|
21952
|
-
credentialId: external_exports.uuid().optional(),
|
|
21953
|
-
providerUserId: external_exports.string().min(1).optional()
|
|
21954
|
-
});
|
|
21955
|
-
runCodexCredentialRefreshRequestSchema = external_exports.object({
|
|
21956
|
-
/** sha256 hex of the access token Codex was refused with; a newer stored token is returned instead of rotating. */
|
|
21957
|
-
rejectedAccessTokenSha256: external_exports.string().regex(/^[0-9a-f]{64}$/).optional()
|
|
21958
|
-
});
|
|
21959
|
-
runProviderCredentialSchema = external_exports.object({
|
|
21960
|
-
/** Environment variables for the agent CLI, e.g. ANTHROPIC_API_KEY; empty when the CLI's own login is used. */
|
|
21961
|
-
env: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21962
|
-
/** The bound Codex login for a cloud sandbox; absent where the CLI's own login is used. */
|
|
21963
|
-
codex: runCodexCredentialSchema.optional()
|
|
21964
|
-
});
|
|
21965
|
-
}
|
|
21966
|
-
});
|
|
21967
|
-
|
|
21968
22078
|
// ../shared/src/runtime-v2/link.ts
|
|
21969
|
-
|
|
21970
|
-
return external_exports.discriminatedUnion("ok", [
|
|
21971
|
-
external_exports.object({ ok: external_exports.literal(true), value }),
|
|
21972
|
-
external_exports.object({ ok: external_exports.literal(false), error: queryErrorSchema })
|
|
21973
|
-
]);
|
|
21974
|
-
}
|
|
21975
|
-
var LINK_PROTOCOL, linkHandshakeSchema, linkAuthSchema, heldRunStateSchema, heldRunSchema, helloSchema, helloAckSchema, pokeReasonSchema, prewarmPokeSchema, pokeSchema, queryErrorSchema, RUN_ANSWER_MAX_LENGTH, toolCallIdSchema, runAnswerSchema, runRespondRequestSchema, runRespondStatusSchema, runRespondResultSchema, runSteerRequestSchema, runSteerStatusSchema, runSteerResultSchema, backgroundTaskIdSchema, runStopTaskRequestSchema, backgroundTaskStopResultSchema, runStopTaskResultSchema, LINK_CONNECT_ERROR_CODES, linkConnectErrorSchema, LINK_FAILURE_REASONS;
|
|
22079
|
+
var LINK_PROTOCOL, linkHandshakeSchema, linkAuthSchema, heldRunStateSchema, heldRunSchema, helloSchema, helloAckSchema, pokeReasonSchema, prewarmPokeSchema, pokeSchema, RUN_ANSWER_MAX_LENGTH, toolCallIdSchema, runAnswerSchema, runRespondRequestSchema, runRespondStatusSchema, runRespondResultSchema, runSteerRequestSchema, runSteerStatusSchema, runSteerResultSchema, backgroundTaskIdSchema, runStopTaskRequestSchema, backgroundTaskStopResultSchema, runStopTaskResultSchema, LINK_CONNECT_ERROR_CODES, linkConnectErrorSchema, LINK_FAILURE_REASONS;
|
|
21976
22080
|
var init_link = __esm({
|
|
21977
22081
|
"../shared/src/runtime-v2/link.ts"() {
|
|
21978
22082
|
"use strict";
|
|
@@ -21980,6 +22084,7 @@ var init_link = __esm({
|
|
|
21980
22084
|
init_desired_state();
|
|
21981
22085
|
init_ids();
|
|
21982
22086
|
init_machine_identity();
|
|
22087
|
+
init_query_result();
|
|
21983
22088
|
init_run_context();
|
|
21984
22089
|
init_session_interaction();
|
|
21985
22090
|
init_workspace();
|
|
@@ -22028,10 +22133,6 @@ var init_link = __esm({
|
|
|
22028
22133
|
conversationId: conversationIdSchema
|
|
22029
22134
|
});
|
|
22030
22135
|
pokeSchema = external_exports.union([external_exports.object({ reason: pokeReasonSchema }), prewarmPokeSchema]);
|
|
22031
|
-
queryErrorSchema = external_exports.object({
|
|
22032
|
-
code: external_exports.string().min(1),
|
|
22033
|
-
message: external_exports.string()
|
|
22034
|
-
});
|
|
22035
22136
|
RUN_ANSWER_MAX_LENGTH = 1e5;
|
|
22036
22137
|
toolCallIdSchema = external_exports.string().min(1).max(1e3);
|
|
22037
22138
|
runAnswerSchema = external_exports.string().max(RUN_ANSWER_MAX_LENGTH);
|
|
@@ -22106,97 +22207,6 @@ var init_link = __esm({
|
|
|
22106
22207
|
}
|
|
22107
22208
|
});
|
|
22108
22209
|
|
|
22109
|
-
// ../shared/src/runtime-v2/capabilities.ts
|
|
22110
|
-
var PROVIDER_MODELS_MAX, providerAuthStateSchema, PROVIDER_MODEL_VARIANTS_MAX, providerModelVariantSchema, providerModelBillingSchema, providerModelSchema, providerModelsSourceSchema, providerCapabilitySchema, machineFactsSchema, machineCapabilitiesSchema, modelsScanRequestSchema, modelsScanResultSchema, capabilitiesAckSchema;
|
|
22111
|
-
var init_capabilities = __esm({
|
|
22112
|
-
"../shared/src/runtime-v2/capabilities.ts"() {
|
|
22113
|
-
"use strict";
|
|
22114
|
-
init_zod();
|
|
22115
|
-
init_link();
|
|
22116
|
-
init_machine_identity();
|
|
22117
|
-
PROVIDER_MODELS_MAX = 2e3;
|
|
22118
|
-
providerAuthStateSchema = external_exports.enum(["signed_in", "signed_out", "unknown"]);
|
|
22119
|
-
PROVIDER_MODEL_VARIANTS_MAX = 32;
|
|
22120
|
-
providerModelVariantSchema = external_exports.string().min(1).max(64).regex(/^[^\s\p{Cc}]+$/u);
|
|
22121
|
-
providerModelBillingSchema = external_exports.enum(["free", "paid"]);
|
|
22122
|
-
providerModelSchema = external_exports.object({
|
|
22123
|
-
id: external_exports.string().min(1).max(200),
|
|
22124
|
-
label: external_exports.string().min(1).max(200).optional(),
|
|
22125
|
-
/** The CLI's reasoning variants in its own order; empty when it says the model has none. */
|
|
22126
|
-
variants: external_exports.array(providerModelVariantSchema).max(PROVIDER_MODEL_VARIANTS_MAX).optional(),
|
|
22127
|
-
billing: providerModelBillingSchema.optional()
|
|
22128
|
-
});
|
|
22129
|
-
providerModelsSourceSchema = external_exports.enum(["discovered", "catalog"]);
|
|
22130
|
-
providerCapabilitySchema = external_exports.object({
|
|
22131
|
-
backendKind: external_exports.string().min(1).max(64),
|
|
22132
|
-
installed: external_exports.boolean(),
|
|
22133
|
-
version: external_exports.string().min(1).max(200).optional(),
|
|
22134
|
-
auth: providerAuthStateSchema,
|
|
22135
|
-
/** What the user has to do when `auth` is `signed_out`, e.g. the login command. */
|
|
22136
|
-
authMessage: external_exports.string().min(1).max(1e3).optional(),
|
|
22137
|
-
/** Provider-reported account tier or API-key mode; never inferred from executable presence. */
|
|
22138
|
-
authLabel: external_exports.string().min(1).max(100).optional(),
|
|
22139
|
-
/** Whether `--version` ran. Absent: not probed; a label, never a reason to hide the provider. */
|
|
22140
|
-
runStatus: external_exports.enum(["ready", "cannot_start"]).optional(),
|
|
22141
|
-
/** The CLI's own first line when it could not start. */
|
|
22142
|
-
runMessage: external_exports.string().min(1).max(1e3).optional(),
|
|
22143
|
-
/** Absent: the CLI has no model list the runtime can read; the server keeps its catalog. */
|
|
22144
|
-
models: external_exports.array(providerModelSchema).max(PROVIDER_MODELS_MAX).optional(),
|
|
22145
|
-
/** Present with `models`. */
|
|
22146
|
-
modelsSource: providerModelsSourceSchema.optional(),
|
|
22147
|
-
/** Ids the CLI itself marks deprecated; never in `models`. Absence is not a deprecation. */
|
|
22148
|
-
deprecatedModels: external_exports.array(external_exports.string().min(1).max(200)).max(PROVIDER_MODELS_MAX).optional(),
|
|
22149
|
-
/** The runtime can hand a mid-run message to the running turn. Absent: it cannot. */
|
|
22150
|
-
steer: external_exports.boolean().optional(),
|
|
22151
|
-
checkedAt: external_exports.number().int().nonnegative()
|
|
22152
|
-
});
|
|
22153
|
-
machineFactsSchema = machinePlatformSchema.extend({
|
|
22154
|
-
osRelease: external_exports.string().min(1).max(200),
|
|
22155
|
-
cpuCount: external_exports.number().int().nonnegative(),
|
|
22156
|
-
totalMemoryBytes: external_exports.number().int().nonnegative()
|
|
22157
|
-
});
|
|
22158
|
-
machineCapabilitiesSchema = external_exports.object({
|
|
22159
|
-
providers: external_exports.array(providerCapabilitySchema).max(64),
|
|
22160
|
-
hasGit: external_exports.boolean(),
|
|
22161
|
-
/**
|
|
22162
|
-
* The runtime answers `files.*` workspace queries and pushes `workspace.changed`. Absent: an
|
|
22163
|
-
* older runtime; the server lists and reads files through the sandbox provider instead.
|
|
22164
|
-
*/
|
|
22165
|
-
workspaceFiles: external_exports.boolean().optional(),
|
|
22166
|
-
machine: machineFactsSchema,
|
|
22167
|
-
scannedAt: external_exports.number().int().nonnegative()
|
|
22168
|
-
});
|
|
22169
|
-
modelsScanRequestSchema = external_exports.object({ refresh: external_exports.boolean().optional() });
|
|
22170
|
-
modelsScanResultSchema = queryResultSchema(machineCapabilitiesSchema);
|
|
22171
|
-
capabilitiesAckSchema = external_exports.object({ stored: external_exports.boolean() });
|
|
22172
|
-
}
|
|
22173
|
-
});
|
|
22174
|
-
|
|
22175
|
-
// ../shared/src/validators/attachments.ts
|
|
22176
|
-
var MAX_COMMENT_ATTACHMENTS, requestPresignedUploadSchema, linkAttachmentSchema, renameAttachmentSchema;
|
|
22177
|
-
var init_attachments = __esm({
|
|
22178
|
-
"../shared/src/validators/attachments.ts"() {
|
|
22179
|
-
"use strict";
|
|
22180
|
-
init_zod();
|
|
22181
|
-
MAX_COMMENT_ATTACHMENTS = 10;
|
|
22182
|
-
requestPresignedUploadSchema = external_exports.object({
|
|
22183
|
-
filename: external_exports.string().min(1).max(500),
|
|
22184
|
-
mimeType: external_exports.string().min(1).max(200),
|
|
22185
|
-
size: external_exports.number().int().positive().max(50 * 1024 * 1024),
|
|
22186
|
-
// 50MB max
|
|
22187
|
-
entityType: external_exports.string().min(1).max(50),
|
|
22188
|
-
entityId: external_exports.uuid().optional()
|
|
22189
|
-
});
|
|
22190
|
-
linkAttachmentSchema = external_exports.object({
|
|
22191
|
-
entityType: external_exports.string().min(1).max(50),
|
|
22192
|
-
entityId: external_exports.uuid()
|
|
22193
|
-
});
|
|
22194
|
-
renameAttachmentSchema = external_exports.object({
|
|
22195
|
-
displayName: external_exports.string().trim().min(1).max(500)
|
|
22196
|
-
});
|
|
22197
|
-
}
|
|
22198
|
-
});
|
|
22199
|
-
|
|
22200
22210
|
// ../shared/src/agent/problem.ts
|
|
22201
22211
|
var ALAN_PROBLEM_SEVERITIES, ALAN_PROBLEM_RECOVERY_MODES, AGENT_CLI_PROBLEM_PHASES, AGENT_CLI_PROBLEM_FINALITIES, AGENT_CLI_OUTCOME_CERTAINTIES, AGENT_CLI_RETRY_OWNERS, APPLICATION_PROBLEM_PHASES, APPLICATION_PROBLEM_TRANSPORT_KINDS, AGENT_CLI_PROBLEM_CODES, APPLICATION_PROBLEM_CODES, alanProblemScopeSchema, alanProblemRecoverySchema, alanProblemBaseShape, agentCliProblemOriginSchema, agentCliProblemLifecycleSchema, agentCliProblemNativeSchema, agentCliProblemV1Schema, applicationProblemOriginSchema, applicationProblemTransportSchema, applicationProblemV1Schema, alanProblemV1Schema;
|
|
22202
22212
|
var init_problem = __esm({
|
|
@@ -24467,10 +24477,21 @@ var REQUEST_TIMEOUT_MS = 3e4;
|
|
|
24467
24477
|
function isRetryableStatus(status) {
|
|
24468
24478
|
return status === 408 || status === 425 || status === 429 || status >= 500;
|
|
24469
24479
|
}
|
|
24480
|
+
function uploadErrorCode(response) {
|
|
24481
|
+
const body = jsonBodyOrNull(response);
|
|
24482
|
+
if (body === null || typeof body !== "object" || !("code" in body)) return void 0;
|
|
24483
|
+
return typeof body.code === "string" ? body.code : void 0;
|
|
24484
|
+
}
|
|
24470
24485
|
function uploadFailure(response) {
|
|
24471
24486
|
if (isRetryableStatus(response.status)) return { kind: "retry", status: response.status };
|
|
24472
24487
|
if (isOk(response)) return null;
|
|
24473
|
-
|
|
24488
|
+
const code = uploadErrorCode(response);
|
|
24489
|
+
return {
|
|
24490
|
+
kind: "rejected",
|
|
24491
|
+
status: response.status,
|
|
24492
|
+
message: textBody(response),
|
|
24493
|
+
...code === void 0 ? {} : { code }
|
|
24494
|
+
};
|
|
24474
24495
|
}
|
|
24475
24496
|
function createApiClient({
|
|
24476
24497
|
apiUrl,
|
|
@@ -24490,7 +24511,10 @@ function createApiClient({
|
|
|
24490
24511
|
[RUN_LOG_PROTOCOL_HEADER]: String(RUN_LOG_PROTOCOL)
|
|
24491
24512
|
});
|
|
24492
24513
|
const toOutcome = (response) => {
|
|
24493
|
-
if (response.status === 409)
|
|
24514
|
+
if (response.status === 409) {
|
|
24515
|
+
const code = uploadErrorCode(response);
|
|
24516
|
+
return { kind: "offset_conflict", ...code === void 0 ? {} : { code } };
|
|
24517
|
+
}
|
|
24494
24518
|
const failure2 = uploadFailure(response);
|
|
24495
24519
|
if (failure2 !== null) return failure2;
|
|
24496
24520
|
const parsed = runLogUploadResponseSchema.safeParse(jsonBody(response));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alan-ai-hq/agent-manager-linux-arm64",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.190",
|
|
4
4
|
"description": "Alan machine runtime (alan-agent) for one platform: the official Node.js binary, the runtime bundle and its launcher. Installed by @alan-ai-hq/agent-manager.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"homepage": "https://tryalan.ai",
|