@omercnet/paseo-omp 0.2.1
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/CHANGELOG.md +87 -0
- package/LICENSE +21 -0
- package/README.md +110 -0
- package/SUPPORT.md +40 -0
- package/TESTING.md +147 -0
- package/client/hub-icon.tsx +12 -0
- package/client/hub-popover.tsx +132 -0
- package/client/hub-status.ts +29 -0
- package/client/memory-panel.tsx +71 -0
- package/client/memory-popover.tsx +70 -0
- package/client/omp-config-surface.tsx +1274 -0
- package/client/omp-doc-links.ts +117 -0
- package/client/omp-plugin-manager.tsx +833 -0
- package/client/provider-diagnostics-state.ts +250 -0
- package/client/provider-icon.tsx +27 -0
- package/client/provider-image.tsx +66 -0
- package/client/quota-popover.tsx +150 -0
- package/client/quota-state.ts +131 -0
- package/client/sessions-popover.tsx +73 -0
- package/docs/alpha-release-checklist.md +70 -0
- package/docs/configuration.md +122 -0
- package/docs/core-provider-issue-audit.md +108 -0
- package/docs/installation.md +73 -0
- package/index.client.tsx +272 -0
- package/index.server.ts +51 -0
- package/package.json +84 -0
- package/paseo-plugin.json +5 -0
- package/server/hub.ts +145 -0
- package/server/memory.ts +86 -0
- package/server/mutation-queue.ts +12 -0
- package/server/omp-config.ts +126 -0
- package/server/omp-plugins.ts +627 -0
- package/server/omp-settings.ts +291 -0
- package/server/paths.ts +64 -0
- package/server/provider/catalog.ts +173 -0
- package/server/provider/config-normalization.ts +148 -0
- package/server/provider/connection.ts +992 -0
- package/server/provider/host-tools.ts +706 -0
- package/server/provider/image.ts +143 -0
- package/server/provider/mcp-transport.ts +394 -0
- package/server/provider/omp-rpc.ts +2739 -0
- package/server/provider/omp.svg +5 -0
- package/server/provider/provider-options.ts +27 -0
- package/server/provider/registration.ts +151 -0
- package/server/provider/security.ts +317 -0
- package/server/provider/session-descriptors.ts +431 -0
- package/server/provider/session.ts +4451 -0
- package/server/provider/settings.ts +78 -0
- package/server/provider/subsessions.ts +847 -0
- package/server/provider/timeline-projector.ts +1764 -0
- package/server/provider-diagnostics.ts +1057 -0
- package/server/quota.ts +54 -0
- package/server/sessions.ts +58 -0
- package/shared/hub.ts +43 -0
- package/shared/memory.ts +23 -0
- package/shared/omp-config.ts +81 -0
- package/shared/omp-plugins.ts +223 -0
- package/shared/omp-settings.ts +207 -0
- package/shared/provider-diagnostics.ts +117 -0
- package/shared/provider-image.ts +160 -0
- package/shared/quota.ts +22 -0
- package/shared/sessions.ts +23 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const MAX_COMMAND_PARTS = 64;
|
|
4
|
+
const MAX_ENV_ENTRIES = 256;
|
|
5
|
+
const MAX_TEXT_BYTES = 64 * 1024;
|
|
6
|
+
const MAX_MODEL_SELECTOR_BYTES = 513;
|
|
7
|
+
const MAX_PATH_BYTES = 4_096;
|
|
8
|
+
const MAX_RPC_TIMEOUT_MS = 10 * 60 * 1_000;
|
|
9
|
+
|
|
10
|
+
function boundedString(maxBytes: number) {
|
|
11
|
+
return z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.refine((value) => Buffer.byteLength(value, "utf8") <= maxBytes);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const CommandPartSchema = boundedString(MAX_PATH_BYTES).refine(
|
|
18
|
+
(value) => !value.includes("\0") && !/[\r\n]/u.test(value),
|
|
19
|
+
"command arguments cannot contain NUL or line breaks",
|
|
20
|
+
);
|
|
21
|
+
const EnvironmentNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/u);
|
|
22
|
+
const EnvironmentValueSchema = z
|
|
23
|
+
.string()
|
|
24
|
+
.refine((value) => Buffer.byteLength(value, "utf8") <= MAX_TEXT_BYTES && !value.includes("\0"));
|
|
25
|
+
const ModelSelectorSchema = boundedString(MAX_MODEL_SELECTOR_BYTES).refine(
|
|
26
|
+
(value) => !value.includes("\0"),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/** Native approval modes are available because provider permissions are bridged to Paseo. */
|
|
30
|
+
export const OmpModeSchema = z.enum(["full", "write", "ask"]);
|
|
31
|
+
export const OmpOutputRedactionSchema = z.enum(["none", "configured-values"]).default("none");
|
|
32
|
+
|
|
33
|
+
export const OmpProviderParamsSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
sessionDir: boundedString(MAX_PATH_BYTES)
|
|
36
|
+
.describe("OMP session directory passed through --session-dir")
|
|
37
|
+
.optional(),
|
|
38
|
+
rpcTimeoutMs: z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.positive()
|
|
42
|
+
.max(MAX_RPC_TIMEOUT_MS)
|
|
43
|
+
.describe("Shared OMP startup and RPC timeout in milliseconds")
|
|
44
|
+
.optional(),
|
|
45
|
+
smolModel: ModelSelectorSchema.describe("OMP smol role model selector").optional(),
|
|
46
|
+
slowModel: ModelSelectorSchema.describe("OMP slow role model selector").optional(),
|
|
47
|
+
planModel: ModelSelectorSchema.describe("OMP plan role model selector").optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
|
|
51
|
+
/** Strict provider-scoped OMP launch options. */
|
|
52
|
+
export const OmpProviderOptionsSchema = z
|
|
53
|
+
.object({
|
|
54
|
+
command: z
|
|
55
|
+
.array(CommandPartSchema)
|
|
56
|
+
.min(1)
|
|
57
|
+
.max(MAX_COMMAND_PARTS)
|
|
58
|
+
.describe("Complete OMP executable and argument prefix")
|
|
59
|
+
.optional(),
|
|
60
|
+
env: z
|
|
61
|
+
.record(EnvironmentNameSchema, EnvironmentValueSchema)
|
|
62
|
+
.describe("Profile environment applied before session launch environment")
|
|
63
|
+
.optional(),
|
|
64
|
+
inheritEnv: z
|
|
65
|
+
.array(EnvironmentNameSchema)
|
|
66
|
+
.max(MAX_ENV_ENTRIES)
|
|
67
|
+
.describe("Daemon environment variable names copied at OMP spawn time")
|
|
68
|
+
.optional(),
|
|
69
|
+
outputRedaction: OmpOutputRedactionSchema.describe(
|
|
70
|
+
"Best-effort exact replacement of explicitly configured credential values in public output",
|
|
71
|
+
),
|
|
72
|
+
params: OmpProviderParamsSchema.optional(),
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
|
|
76
|
+
export type OmpMode = z.infer<typeof OmpModeSchema>;
|
|
77
|
+
export type OmpOutputRedaction = z.infer<typeof OmpOutputRedactionSchema>;
|
|
78
|
+
export type OmpProviderOptions = z.infer<typeof OmpProviderOptionsSchema>;
|