@ericsanchezok/synergy-util 3.0.24 → 3.1.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/LICENSE.codex +201 -0
- package/NOTICE +9 -0
- package/dist/activity.d.ts +9 -4
- package/dist/activity.js +20 -19
- package/dist/asset-reference.d.ts +15 -0
- package/dist/asset-reference.js +98 -0
- package/dist/atomic-file.d.ts +9 -0
- package/dist/atomic-file.js +86 -0
- package/dist/attachment-presentation.d.ts +26 -0
- package/dist/attachment-presentation.js +11 -0
- package/dist/capability.d.ts +1 -1
- package/dist/capability.js +5 -19
- package/dist/cli-command.d.ts +12 -0
- package/dist/cli-command.js +3 -0
- package/dist/encode.d.ts +3 -0
- package/dist/encode.js +7 -0
- package/dist/error.d.ts +36 -56
- package/dist/feature-config.d.ts +4 -0
- package/dist/feature-config.js +23 -0
- package/dist/features.d.ts +134 -0
- package/dist/features.js +195 -0
- package/dist/file-patch.d.ts +31 -0
- package/dist/file-patch.js +218 -0
- package/dist/filesystem-identity.d.ts +28 -0
- package/dist/filesystem-identity.js +71 -0
- package/dist/fn.d.ts +1 -1
- package/dist/fs-lock.d.ts +5 -1
- package/dist/fs-lock.js +14 -6
- package/dist/input-assistance.d.ts +51 -0
- package/dist/input-assistance.js +61 -0
- package/dist/installed-launcher.d.ts +18 -0
- package/dist/installed-launcher.js +39 -0
- package/dist/io-retry.d.ts +11 -0
- package/dist/io-retry.js +36 -0
- package/dist/json-value.d.ts +4 -0
- package/dist/json-value.js +12 -0
- package/dist/markdown-assets.d.ts +6 -0
- package/dist/markdown-assets.js +29 -0
- package/dist/markdown-link.d.ts +2 -0
- package/dist/markdown-link.js +8 -0
- package/dist/native-assets.d.ts +7 -0
- package/dist/native-assets.js +28 -0
- package/dist/network-error.d.ts +7 -0
- package/dist/network-error.js +111 -0
- package/dist/plugin-policy.d.ts +1 -1
- package/dist/process-group.d.ts +45 -0
- package/dist/process-group.js +156 -0
- package/dist/process-identity.js +5 -2
- package/dist/projection-patch.d.ts +9 -0
- package/dist/projection-patch.js +74 -0
- package/dist/reasoning-item.d.ts +1 -0
- package/dist/reasoning-item.js +16 -0
- package/dist/render-artifact.d.ts +352 -0
- package/dist/render-artifact.js +115 -0
- package/dist/render-ui.d.ts +202 -0
- package/dist/render-ui.js +208 -0
- package/dist/resource-reference.d.ts +73 -0
- package/dist/resource-reference.js +227 -0
- package/dist/retry.d.ts +4 -0
- package/dist/retry.js +56 -23
- package/dist/runtime-startup.d.ts +240 -2
- package/dist/runtime-startup.js +108 -9
- package/dist/terminal.d.ts +217 -0
- package/dist/terminal.js +111 -0
- package/dist/tool-display.d.ts +10 -0
- package/dist/tool-display.js +22 -1
- package/dist/tool-timeout.d.ts +21 -0
- package/dist/tool-timeout.js +1 -0
- package/dist/tool.d.ts +6 -7
- package/dist/workbench-view.d.ts +692 -0
- package/dist/workbench-view.js +90 -0
- package/dist/worker-plan.d.ts +39 -0
- package/dist/worker-plan.js +33 -0
- package/package.json +28 -4
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AssetReference } from "./asset-reference";
|
|
3
|
+
import { ResourceReference } from "./resource-reference";
|
|
4
|
+
export var WorkbenchView;
|
|
5
|
+
(function (WorkbenchView) {
|
|
6
|
+
WorkbenchView.VERSION = 1;
|
|
7
|
+
const identity = z.string().min(1);
|
|
8
|
+
WorkbenchView.TargetKind = z.enum(["note", "workspace-file", "browser-page", "asset"]);
|
|
9
|
+
WorkbenchView.Target = z.discriminatedUnion("kind", [
|
|
10
|
+
z.object({ kind: z.literal("note"), id: identity, location: ResourceReference.Location.optional() }).strict(),
|
|
11
|
+
z
|
|
12
|
+
.object({ kind: z.literal("workspace-file"), path: identity, location: ResourceReference.Location.optional() })
|
|
13
|
+
.strict(),
|
|
14
|
+
z.object({ kind: z.literal("browser-page"), pageId: identity }).strict(),
|
|
15
|
+
z
|
|
16
|
+
.object({
|
|
17
|
+
kind: z.literal("asset"),
|
|
18
|
+
url: identity.refine((value) => AssetReference.parse(value)?.url === value, "Use an immutable asset:// reference."),
|
|
19
|
+
location: ResourceReference.Location.optional(),
|
|
20
|
+
})
|
|
21
|
+
.strict(),
|
|
22
|
+
]);
|
|
23
|
+
WorkbenchView.Command = z.discriminatedUnion("action", [
|
|
24
|
+
z.object({ action: z.literal("open"), target: WorkbenchView.Target }).strict(),
|
|
25
|
+
z.object({ action: z.literal("hide"), viewId: identity }).strict(),
|
|
26
|
+
z.object({ action: z.literal("status"), requestId: identity.optional() }).strict(),
|
|
27
|
+
]);
|
|
28
|
+
WorkbenchView.Parameters = z
|
|
29
|
+
.object({
|
|
30
|
+
input: WorkbenchView.Command,
|
|
31
|
+
clientId: identity
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("An eligible frontend ID returned by status when multiple frontends show this session."),
|
|
34
|
+
timeoutSeconds: z
|
|
35
|
+
.number()
|
|
36
|
+
.positive()
|
|
37
|
+
.finite()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Seconds to wait for a frontend receipt. A missing receipt is unknown, not success."),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
WorkbenchView.View = z
|
|
43
|
+
.object({
|
|
44
|
+
viewId: identity,
|
|
45
|
+
surface: z.enum(["side", "bottom"]),
|
|
46
|
+
target: WorkbenchView.Target,
|
|
47
|
+
visible: z.boolean(),
|
|
48
|
+
contentState: z.enum(["loading", "ready", "unavailable"]),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
WorkbenchView.Client = z.object({ clientId: identity }).strict();
|
|
52
|
+
WorkbenchView.Outcome = z
|
|
53
|
+
.object({
|
|
54
|
+
status: z.enum(["applied", "unavailable", "blocked", "superseded", "unknown", "ambiguous", "cancelled"]),
|
|
55
|
+
reason: z.string().optional(),
|
|
56
|
+
views: z.array(WorkbenchView.View).optional(),
|
|
57
|
+
clients: z.array(WorkbenchView.Client).optional(),
|
|
58
|
+
})
|
|
59
|
+
.strict();
|
|
60
|
+
WorkbenchView.Result = WorkbenchView.Outcome.extend({ requestId: identity, clientId: identity.optional() });
|
|
61
|
+
WorkbenchView.Request = z
|
|
62
|
+
.object({
|
|
63
|
+
requestId: identity,
|
|
64
|
+
scopeID: identity,
|
|
65
|
+
sessionID: identity,
|
|
66
|
+
command: WorkbenchView.Command,
|
|
67
|
+
context: ResourceReference.Context.optional(),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
WorkbenchView.ServerMessage = z.discriminatedUnion("type", [
|
|
71
|
+
z.object({ type: z.literal("server.workbench.request"), properties: WorkbenchView.Request }).strict(),
|
|
72
|
+
z
|
|
73
|
+
.object({ type: z.literal("server.workbench.cancel"), properties: z.object({ requestId: identity }).strict() })
|
|
74
|
+
.strict(),
|
|
75
|
+
]);
|
|
76
|
+
WorkbenchView.ClientMessage = z.discriminatedUnion("type", [
|
|
77
|
+
z
|
|
78
|
+
.object({
|
|
79
|
+
type: z.literal("client.workbench.ready"),
|
|
80
|
+
properties: z.object({ version: z.literal(WorkbenchView.VERSION), targets: z.array(WorkbenchView.TargetKind) }).strict(),
|
|
81
|
+
})
|
|
82
|
+
.strict(),
|
|
83
|
+
z
|
|
84
|
+
.object({
|
|
85
|
+
type: z.literal("client.workbench.receipt"),
|
|
86
|
+
properties: z.object({ requestId: identity, outcome: WorkbenchView.Outcome }).strict(),
|
|
87
|
+
})
|
|
88
|
+
.strict(),
|
|
89
|
+
]);
|
|
90
|
+
})(WorkbenchView || (WorkbenchView = {}));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ComponentWorkerPlan: z.ZodObject<{
|
|
3
|
+
apiVersion: z.ZodLiteral<2>;
|
|
4
|
+
agent: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
entry: z.ZodString;
|
|
8
|
+
}, z.core.$strict>>;
|
|
9
|
+
policy: z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
version: z.ZodString;
|
|
12
|
+
entry: z.ZodString;
|
|
13
|
+
}, z.core.$strict>>;
|
|
14
|
+
features: z.ZodObject<{
|
|
15
|
+
definitions: z.ZodArray<z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
owner: z.ZodString;
|
|
18
|
+
maturity: z.ZodEnum<{
|
|
19
|
+
experimental: "experimental";
|
|
20
|
+
stable: "stable";
|
|
21
|
+
}>;
|
|
22
|
+
activation: z.ZodEnum<{
|
|
23
|
+
live: "live";
|
|
24
|
+
restart: "restart";
|
|
25
|
+
}>;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
description: z.ZodString;
|
|
28
|
+
component: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
optIn: z.ZodArray<z.ZodString>;
|
|
31
|
+
selection: z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
version: z.ZodString;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
components: z.ZodArray<z.ZodString>;
|
|
36
|
+
requirements: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type ComponentWorkerPlan = z.infer<typeof ComponentWorkerPlan>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FeaturePlan } from "./features";
|
|
3
|
+
const Entry = z
|
|
4
|
+
.object({
|
|
5
|
+
id: z.string().min(1),
|
|
6
|
+
version: z.string().min(1),
|
|
7
|
+
entry: z
|
|
8
|
+
.string()
|
|
9
|
+
.url()
|
|
10
|
+
.refine((value) => new URL(value).protocol === "file:", "Worker entries must be local files"),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
export const ComponentWorkerPlan = z
|
|
14
|
+
.object({ apiVersion: z.literal(2), agent: z.array(Entry), policy: z.array(Entry), features: FeaturePlan })
|
|
15
|
+
.strict()
|
|
16
|
+
.superRefine((plan, context) => {
|
|
17
|
+
const versions = new Map(plan.features.selection.map(({ id, version }) => [id, version]));
|
|
18
|
+
for (const role of ["agent", "policy"]) {
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
for (const entry of plan[role]) {
|
|
21
|
+
const message = seen.has(entry.id)
|
|
22
|
+
? `Duplicate worker component: ${entry.id}`
|
|
23
|
+
: !plan.features.components.includes(entry.id)
|
|
24
|
+
? `Worker component is not in its host feature plan: ${entry.id}`
|
|
25
|
+
: versions.get(entry.id) !== entry.version
|
|
26
|
+
? `Worker component does not match the host composition: ${entry.id}`
|
|
27
|
+
: undefined;
|
|
28
|
+
if (message)
|
|
29
|
+
context.addIssue({ code: "custom", path: [role], message });
|
|
30
|
+
seen.add(entry.id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ericsanchezok/synergy-util",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
@@ -11,6 +11,26 @@
|
|
|
11
11
|
"./pty-keys": {
|
|
12
12
|
"types": "./dist/pty-keys.d.ts",
|
|
13
13
|
"import": "./dist/pty-keys.js"
|
|
14
|
+
},
|
|
15
|
+
"./terminal": {
|
|
16
|
+
"types": "./dist/terminal.d.ts",
|
|
17
|
+
"import": "./dist/terminal.js"
|
|
18
|
+
},
|
|
19
|
+
"./cli-command": {
|
|
20
|
+
"types": "./dist/cli-command.d.ts",
|
|
21
|
+
"import": "./dist/cli-command.js"
|
|
22
|
+
},
|
|
23
|
+
"./atomic-file": {
|
|
24
|
+
"types": "./dist/atomic-file.d.ts",
|
|
25
|
+
"import": "./dist/atomic-file.js"
|
|
26
|
+
},
|
|
27
|
+
"./io-retry": {
|
|
28
|
+
"types": "./dist/io-retry.d.ts",
|
|
29
|
+
"import": "./dist/io-retry.js"
|
|
30
|
+
},
|
|
31
|
+
"./installed-launcher": {
|
|
32
|
+
"types": "./dist/installed-launcher.d.ts",
|
|
33
|
+
"import": "./dist/installed-launcher.js"
|
|
14
34
|
}
|
|
15
35
|
},
|
|
16
36
|
"scripts": {
|
|
@@ -19,9 +39,13 @@
|
|
|
19
39
|
"test": "bun test test/*.test.ts"
|
|
20
40
|
},
|
|
21
41
|
"files": [
|
|
22
|
-
"dist"
|
|
42
|
+
"dist",
|
|
43
|
+
"LICENSE.codex",
|
|
44
|
+
"NOTICE"
|
|
23
45
|
],
|
|
24
46
|
"dependencies": {
|
|
25
|
-
"
|
|
47
|
+
"jsonc-parser": "3.3.1",
|
|
48
|
+
"marked": "18.1.1",
|
|
49
|
+
"zod": "4.6.7"
|
|
26
50
|
}
|
|
27
|
-
}
|
|
51
|
+
}
|