@the-open-engine/zeroshot 6.23.0 → 6.25.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/cli/index.js +37 -2
- package/docker/zeroshot-cluster/Dockerfile +7 -0
- package/lib/agent-cli-provider/adapters/omp.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/omp.js +37 -11
- package/lib/agent-cli-provider/adapters/omp.js.map +1 -1
- package/lib/agent-cli-provider/omp-release.d.ts +3 -0
- package/lib/agent-cli-provider/omp-release.d.ts.map +1 -1
- package/lib/agent-cli-provider/omp-release.js +20 -1
- package/lib/agent-cli-provider/omp-release.js.map +1 -1
- package/lib/agent-cli-provider/omp-rpc-driver.d.ts.map +1 -1
- package/lib/agent-cli-provider/omp-rpc-driver.js +27 -2
- package/lib/agent-cli-provider/omp-rpc-driver.js.map +1 -1
- package/lib/agent-cli-provider/omp-rpc-session.js +3 -3
- package/lib/agent-cli-provider/omp-rpc-session.js.map +1 -1
- package/lib/agent-cli-provider/provider-registry.d.ts +20 -8
- package/lib/agent-cli-provider/provider-registry.d.ts.map +1 -1
- package/lib/agent-cli-provider/provider-registry.js +56 -9
- package/lib/agent-cli-provider/provider-registry.js.map +1 -1
- package/lib/agent-cli-provider/types.d.ts +2 -0
- package/lib/agent-cli-provider/types.d.ts.map +1 -1
- package/lib/agent-cli-provider/types.js.map +1 -1
- package/lib/docker-config.js +122 -5
- package/package.json +2 -2
- package/src/agent/agent-lifecycle.js +78 -3
- package/src/agent/agent-task-executor.js +72 -3
- package/src/agent/provider-session.js +112 -2
- package/src/agent-cli-provider/adapters/omp.ts +41 -11
- package/src/agent-cli-provider/omp-release.ts +26 -0
- package/src/agent-cli-provider/omp-rpc-driver.ts +31 -3
- package/src/agent-cli-provider/omp-rpc-session.ts +3 -3
- package/src/agent-cli-provider/provider-registry.ts +102 -20
- package/src/agent-cli-provider/types.ts +4 -0
- package/src/isolation-manager.js +535 -89
- package/src/omp-blob-root.js +110 -0
- package/src/omp-config-overlay.js +9 -1
- package/src/omp-execution-fingerprint.js +62 -0
- package/src/omp-session-limits.js +17 -0
- package/src/omp-session-partition.js +297 -0
- package/src/omp-session-verifier.js +576 -0
- package/src/orchestrator.js +11 -1
- package/src/preflight.js +15 -2
- package/task-lib/commands/clean.js +23 -0
- package/task-lib/commands/resume.js +42 -0
- package/task-lib/commands/run.js +65 -0
- package/task-lib/omp-session-cleanup.js +160 -0
- package/task-lib/omp-session-ownership-schema.js +262 -0
- package/task-lib/omp-session-ownership.js +332 -0
- package/task-lib/omp-storage-root.js +35 -0
- package/task-lib/rpc-watcher.js +332 -2
- package/task-lib/runner.js +195 -4
- package/task-lib/store.js +42 -7
|
@@ -2,13 +2,22 @@ import { createAcpAdapter } from './adapters/acp';
|
|
|
2
2
|
import { claudeAdapter } from './adapters/claude';
|
|
3
3
|
import { codexAdapter } from './adapters/codex';
|
|
4
4
|
import { copilotAdapter } from './adapters/copilot';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
gatewayAdapter,
|
|
7
|
+
gatewaySettingsDefaults,
|
|
8
|
+
validateGatewaySettings,
|
|
9
|
+
} from './adapters/gateway';
|
|
6
10
|
import { geminiAdapter } from './adapters/gemini';
|
|
7
11
|
import { opencodeAdapter } from './adapters/opencode';
|
|
8
12
|
import { ompAdapter } from './adapters/omp';
|
|
9
13
|
import { piAdapter } from './adapters/pi';
|
|
10
14
|
import { resolveClaudeCommand } from './claude-command';
|
|
11
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
OMP_AUTH_INSTRUCTIONS,
|
|
17
|
+
OMP_DOCKER_INSTALL_COMMAND,
|
|
18
|
+
OMP_DOCKER_PLATFORM,
|
|
19
|
+
OMP_INSTALL_COMMAND,
|
|
20
|
+
} from './omp-release';
|
|
12
21
|
import type { ModelLevel, ProviderAdapter, StructuredOutputRecoveryAdapter } from './types';
|
|
13
22
|
|
|
14
23
|
export type ProviderCapabilityState = boolean | 'experimental';
|
|
@@ -67,8 +76,24 @@ export interface ProviderDockerMountPreset {
|
|
|
67
76
|
readonly readonly: boolean;
|
|
68
77
|
}
|
|
69
78
|
|
|
79
|
+
export interface ProviderDockerEnvAuth {
|
|
80
|
+
// At least one of these env vars must carry a usable (non-empty, non-whitespace) value for the
|
|
81
|
+
// effective container plan to be considered automatically authenticated. This is the AUTOMATIC
|
|
82
|
+
// allowlist only; a registry-known credential outside it is accepted when — and only when — the
|
|
83
|
+
// user explicitly opted it in (dockerEnvPassthrough / --mount).
|
|
84
|
+
// Providers with no `mount` (env-only) fail closed when nothing is satisfied.
|
|
85
|
+
readonly requireOneOf: readonly string[];
|
|
86
|
+
// Each inner group must be all-set-or-all-unset (e.g. a broker URL + token pair); a partial
|
|
87
|
+
// group is treated as malformed auth, not "missing".
|
|
88
|
+
readonly requireTogether?: readonly (readonly string[])[];
|
|
89
|
+
// Env vars whose value must parse as an absolute http(s) URL to count as set. A non-URL value
|
|
90
|
+
// is malformed auth, not "missing".
|
|
91
|
+
readonly requireUrl?: readonly string[];
|
|
92
|
+
}
|
|
93
|
+
|
|
70
94
|
export interface ProviderDockerMetadata {
|
|
71
|
-
|
|
95
|
+
// Omitted for env-only providers with zero automatic credential mounts (e.g. omp).
|
|
96
|
+
readonly mount?: ProviderDockerMountPreset;
|
|
72
97
|
readonly envPassthrough: readonly string[];
|
|
73
98
|
// False when the mounted dir doesn't hold the secret (auth is via an envPassthrough token).
|
|
74
99
|
readonly credentialInMount?: boolean;
|
|
@@ -76,6 +101,14 @@ export interface ProviderDockerMetadata {
|
|
|
76
101
|
// a docker-cached build layer for the per-provider image variant. Omit for providers already
|
|
77
102
|
// baked into the base image (e.g. Claude) or not installable via a single command.
|
|
78
103
|
readonly install?: string;
|
|
104
|
+
// Docker platform (e.g. 'linux/amd64') passed to both image build and container run. Omitted
|
|
105
|
+
// providers keep today's unset (host-native) behavior.
|
|
106
|
+
readonly platform?: string;
|
|
107
|
+
// $HOME-placeholder directories created owner-only inside the container for this provider's
|
|
108
|
+
// config/session state (never mounted/copied from the host).
|
|
109
|
+
readonly configRoots?: readonly string[];
|
|
110
|
+
// Fail-closed env/broker auth requirement, checked against the effective container env plan.
|
|
111
|
+
readonly envAuth?: ProviderDockerEnvAuth;
|
|
79
112
|
}
|
|
80
113
|
|
|
81
114
|
interface ProviderRegistryEntryBase {
|
|
@@ -405,8 +438,7 @@ export const providerRegistry = [
|
|
|
405
438
|
binary: 'pi',
|
|
406
439
|
command: { kind: 'fixed', command: 'pi', args: [] },
|
|
407
440
|
invoke: SPAWN_INVOKE,
|
|
408
|
-
installInstructions:
|
|
409
|
-
'npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.80.3',
|
|
441
|
+
installInstructions: 'npm install -g --ignore-scripts @earendil-works/pi-coding-agent@0.80.3',
|
|
410
442
|
authInstructions: 'pi\n/login',
|
|
411
443
|
credentialPaths: ['~/.pi'],
|
|
412
444
|
credentialEnvKeys: piAdapter.credentialEnvKeys,
|
|
@@ -452,16 +484,23 @@ export const providerRegistry = [
|
|
|
452
484
|
settingsFields: [],
|
|
453
485
|
availabilityProbe: 'help-or-version',
|
|
454
486
|
// Written out explicitly rather than spread from STANDARD_CAPABILITIES, which defaults
|
|
455
|
-
// dockerIsolation to true; OMP
|
|
487
|
+
// dockerIsolation to true; OMP's Docker path is env/broker-only and sessionless (see
|
|
488
|
+
// AGENTS.md OMP Docker section) rather than the standard credential-mount + resume shape.
|
|
489
|
+
// sessionResume is true as of issue #866: verified UUID partitions, two-phase file
|
|
490
|
+
// verification, and the owner-fenced ownership FSM (task-lib/omp-session-ownership.js) are
|
|
491
|
+
// live end to end for host, worktree, detached cluster-agent, and standalone manual resume.
|
|
492
|
+
// The two are independent: an isolated (Docker) OMP task allocates no session partition at all
|
|
493
|
+
// and launches `--no-session`, so `sessionResume: true` never implies a resumable container
|
|
494
|
+
// turn (task-lib/runner.js#resolveOmpSessionPlan, OMP_SESSIONLESS_ENV).
|
|
456
495
|
capabilities: {
|
|
457
|
-
dockerIsolation:
|
|
496
|
+
dockerIsolation: true,
|
|
458
497
|
worktreeIsolation: true,
|
|
459
498
|
mcpServers: false,
|
|
460
499
|
jsonSchema: false,
|
|
461
500
|
streamJson: true,
|
|
462
501
|
thinkingMode: true,
|
|
463
502
|
reasoningEffort: true,
|
|
464
|
-
sessionResume:
|
|
503
|
+
sessionResume: true,
|
|
465
504
|
webSearch: false,
|
|
466
505
|
},
|
|
467
506
|
docs: {
|
|
@@ -469,12 +508,49 @@ export const providerRegistry = [
|
|
|
469
508
|
setupHeading: 'OMP Setup',
|
|
470
509
|
},
|
|
471
510
|
docker: {
|
|
472
|
-
mount
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
511
|
+
// No `mount`: OMP's Docker credential surface is env/broker-only with zero automatic
|
|
512
|
+
// mounts. `~/.omp`, agent.db, WAL/SHM files, and host refresh tokens are never mounted or
|
|
513
|
+
// copied into the container.
|
|
514
|
+
//
|
|
515
|
+
// envPassthrough is deliberately narrower than `credentialEnvKeys` above (the full adapter
|
|
516
|
+
// credential inventory, used for host inspection/redaction). Exact 5-name automatic
|
|
517
|
+
// allowlist per the maintainer's authoritative clarification (verified verbatim via
|
|
518
|
+
// `gh api repos/the-open-engine/zeroshot/issues/comments/5160272623`): "the exact automatic
|
|
519
|
+
// OMP Docker environment allowlist is only ANTHROPIC_API_KEY, OPENAI_API_KEY,
|
|
520
|
+
// GEMINI_API_KEY, OMP_AUTH_BROKER_URL, and OMP_AUTH_BROKER_TOKEN ... ANTHROPIC_OAUTH_TOKEN,
|
|
521
|
+
// ANTHROPIC_FOUNDRY_API_KEY, GOOGLE_API_KEY, OPENROUTER_API_KEY, and every other
|
|
522
|
+
// credential/path require explicit dockerEnvPassthrough/mount opt-in; OAuth users should
|
|
523
|
+
// prefer the auth broker so host refresh/access tokens do not cross automatically." This
|
|
524
|
+
// supersedes PLAN_READY step 2's nine-name list. Any validator flagging this as missing the
|
|
525
|
+
// four excluded names is checking stale plan text against a clarification it never read.
|
|
526
|
+
platform: OMP_DOCKER_PLATFORM,
|
|
527
|
+
install: OMP_DOCKER_INSTALL_COMMAND,
|
|
528
|
+
configRoots: ['$HOME/.omp'],
|
|
529
|
+
credentialInMount: false,
|
|
530
|
+
envPassthrough: [
|
|
531
|
+
'ANTHROPIC_API_KEY',
|
|
532
|
+
'GEMINI_API_KEY',
|
|
533
|
+
'OMP_AUTH_BROKER_TOKEN',
|
|
534
|
+
'OMP_AUTH_BROKER_URL',
|
|
535
|
+
'OPENAI_API_KEY',
|
|
536
|
+
],
|
|
537
|
+
envAuth: {
|
|
538
|
+
// The four automatic *credential* names (the fifth allowlist entry, OMP_AUTH_BROKER_URL,
|
|
539
|
+
// is a locator, not a credential — it authenticates nothing on its own). Any other
|
|
540
|
+
// registry-known OMP credential (ANTHROPIC_OAUTH_TOKEN, OPENROUTER_API_KEY, …) is usable
|
|
541
|
+
// only via explicit dockerEnvPassthrough/--mount opt-in, never automatic forwarding.
|
|
542
|
+
requireOneOf: [
|
|
543
|
+
'ANTHROPIC_API_KEY',
|
|
544
|
+
'GEMINI_API_KEY',
|
|
545
|
+
'OMP_AUTH_BROKER_TOKEN',
|
|
546
|
+
'OPENAI_API_KEY',
|
|
547
|
+
],
|
|
548
|
+
requireTogether: [['OMP_AUTH_BROKER_URL', 'OMP_AUTH_BROKER_TOKEN']],
|
|
549
|
+
// Per OMP v17.2.1 docs/environment-variables.md, OMP_AUTH_BROKER_URL is the broker's base
|
|
550
|
+
// URL (e.g. https://broker.tailnet:8765); anything that is not an http(s) URL is
|
|
551
|
+
// malformed broker config, and OMP hard-errors on a broker URL with no resolvable token.
|
|
552
|
+
requireUrl: ['OMP_AUTH_BROKER_URL'],
|
|
476
553
|
},
|
|
477
|
-
envPassthrough: [],
|
|
478
554
|
},
|
|
479
555
|
defaultLevels: {
|
|
480
556
|
min: ompAdapter.defaultMinLevel,
|
|
@@ -578,12 +654,16 @@ function validateWebSearchSettings(
|
|
|
578
654
|
type RegistryProviderId = (typeof providerRegistry)[number]['id'];
|
|
579
655
|
type RegistryProviderAlias = (typeof providerRegistry)[number]['aliases'][number];
|
|
580
656
|
|
|
581
|
-
export const providerIds = providerRegistry.map(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
)[];
|
|
657
|
+
export const providerIds = providerRegistry.map(
|
|
658
|
+
(entry) => entry.id
|
|
659
|
+
) as readonly RegistryProviderId[];
|
|
660
|
+
export const providerAliases = providerRegistry.flatMap(
|
|
661
|
+
(entry) => entry.aliases
|
|
662
|
+
) as readonly RegistryProviderAlias[];
|
|
663
|
+
export const knownProviderNames = providerRegistry.flatMap((entry) => [
|
|
664
|
+
entry.id,
|
|
665
|
+
...entry.aliases,
|
|
666
|
+
]) as readonly (RegistryProviderId | RegistryProviderAlias)[];
|
|
587
667
|
|
|
588
668
|
export const providerAliasMap: Readonly<Record<string, RegistryProviderId>> = Object.freeze(
|
|
589
669
|
providerRegistry.reduce<Record<string, RegistryProviderId>>((result, entry) => {
|
|
@@ -621,7 +701,9 @@ export function listProviderRegistryEntries(): readonly ProviderRegistryEntry[]
|
|
|
621
701
|
return providerRegistry;
|
|
622
702
|
}
|
|
623
703
|
|
|
624
|
-
export function findProviderRegistryEntry(
|
|
704
|
+
export function findProviderRegistryEntry(
|
|
705
|
+
name: string | null | undefined
|
|
706
|
+
): ProviderRegistryEntry | undefined {
|
|
625
707
|
if (!name) return undefined;
|
|
626
708
|
const normalized = normalizeProviderName(name);
|
|
627
709
|
return providerRegistry.find((entry) => entry.id === normalized);
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
StructuredOutputProviderRegistryEntry,
|
|
13
13
|
UnstructuredOutputProviderRegistryEntry,
|
|
14
14
|
} from './provider-registry';
|
|
15
|
+
import type { OmpSessionLaunch } from './omp-rpc-session';
|
|
15
16
|
|
|
16
17
|
export type ProviderId = (typeof providerIds)[number];
|
|
17
18
|
export type ProviderAlias = (typeof providerAliases)[number];
|
|
@@ -329,6 +330,9 @@ export interface BuildProviderCommandOptions {
|
|
|
329
330
|
readonly autoApprove?: boolean;
|
|
330
331
|
readonly resumeSessionId?: string;
|
|
331
332
|
readonly continueSession?: boolean;
|
|
333
|
+
// OMP-only: a verified session launch (none/fresh/resume) built from a checked partition —
|
|
334
|
+
// never a raw session id string. See src/agent-cli-provider/omp-rpc-session.ts.
|
|
335
|
+
readonly ompSession?: OmpSessionLaunch;
|
|
332
336
|
readonly webSearch?: boolean;
|
|
333
337
|
readonly claudeSettingsFile?: string;
|
|
334
338
|
readonly cliFeatures?: CliFeatureOverrides;
|