@intentic/sandbox-contract 1.421.0 → 1.423.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/dist/chores/chores.d.ts.map +1 -1
- package/dist/chores/chores.js +1 -48
- package/dist/chores/chores.js.map +1 -1
- package/dist/chores/index.d.ts +1 -1
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +1 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/prompt.d.ts +0 -1
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +0 -2
- package/dist/chores/prompt.js.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +0 -28
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.d.ts +30 -0
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +10 -1
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +46 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/device.contract.js +2 -0
- package/dist/contracts/device.contract.js.map +1 -1
- package/dist/contracts/issues.contract.d.ts +6 -0
- package/dist/contracts/issues.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +51 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.js +3 -3
- package/dist/contracts/offload.contract.js.map +1 -1
- package/dist/contracts/panels.contract.d.ts +0 -7
- package/dist/contracts/panels.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +48 -0
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +2 -17
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +2 -2
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/settings.contract.d.ts +0 -135
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +18 -18
- package/dist/contracts/workspace.contract.d.ts +0 -60
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +1 -11
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/requests.js +1 -1
- package/dist/events/requests.js.map +1 -1
- package/dist/ids/project-id.d.ts +3 -0
- package/dist/ids/project-id.d.ts.map +1 -0
- package/dist/ids/project-id.js +25 -0
- package/dist/ids/project-id.js.map +1 -0
- package/dist/ids/tunnel-ids.d.ts +0 -1
- package/dist/ids/tunnel-ids.d.ts.map +1 -1
- package/dist/ids/tunnel-ids.js +0 -1
- package/dist/ids/tunnel-ids.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/models/account-moves.js +4 -4
- package/dist/models/account-moves.js.map +1 -1
- package/dist/models/model-roles.d.ts +1 -1
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +1 -1
- package/dist/models/model-roles.js.map +1 -1
- package/dist/models/plan-pools.d.ts +3 -1
- package/dist/models/plan-pools.d.ts.map +1 -1
- package/dist/models/plan-pools.js +26 -3
- package/dist/models/plan-pools.js.map +1 -1
- package/dist/protocol/doors/runner-protocol.d.ts +42 -0
- package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/runner-protocol.js +23 -0
- package/dist/protocol/doors/runner-protocol.js.map +1 -1
- package/dist/protocol/doors/sandbox-pass.d.ts +22 -0
- package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -0
- package/dist/protocol/doors/sandbox-pass.js +72 -0
- package/dist/protocol/doors/sandbox-pass.js.map +1 -0
- package/dist/protocol/raw/raw-json-routes.d.ts +96 -9
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-json-routes.js +6 -2
- package/dist/protocol/raw/raw-json-routes.js.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +24 -7
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +6 -2
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +0 -14
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +0 -4
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/certificate-request.d.ts +0 -2
- package/dist/schemas/certificate-request.d.ts.map +1 -1
- package/dist/schemas/ci.d.ts +69 -0
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +30 -0
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/device-files.d.ts +71 -0
- package/dist/schemas/device-files.d.ts.map +1 -0
- package/dist/schemas/device-files.js +53 -0
- package/dist/schemas/device-files.js.map +1 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/hosts.d.ts +3 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +3 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/issues.d.ts +133 -0
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +34 -0
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js +16 -10
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/offload.d.ts +40 -0
- package/dist/schemas/offload.d.ts.map +1 -1
- package/dist/schemas/offload.js +21 -0
- package/dist/schemas/offload.js.map +1 -1
- package/dist/schemas/panels.d.ts +0 -14
- package/dist/schemas/panels.d.ts.map +1 -1
- package/dist/schemas/panels.js +0 -6
- package/dist/schemas/panels.js.map +1 -1
- package/dist/schemas/personas.d.ts.map +1 -1
- package/dist/schemas/personas.js +0 -6
- package/dist/schemas/personas.js.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +1 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +5 -1
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/usage.d.ts +0 -12
- package/dist/schemas/providers/usage.d.ts.map +1 -1
- package/dist/schemas/providers/usage.js +0 -5
- package/dist/schemas/providers/usage.js.map +1 -1
- package/dist/schemas/secrets.d.ts +1 -22
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +3 -13
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings-experiments.d.ts +0 -4
- package/dist/schemas/settings-experiments.d.ts.map +1 -1
- package/dist/schemas/settings-experiments.js +0 -12
- package/dist/schemas/settings-experiments.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +1 -1
- package/dist/schemas/settings-history.d.ts.map +1 -1
- package/dist/schemas/settings-history.js +1 -0
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings-savings.d.ts +0 -144
- package/dist/schemas/settings-savings.d.ts.map +1 -1
- package/dist/schemas/settings-savings.js +1 -3
- package/dist/schemas/settings-savings.js.map +1 -1
- package/dist/schemas/settings.d.ts +0 -4
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +3 -4
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/short-codes.d.ts +0 -10
- package/dist/schemas/short-codes.d.ts.map +1 -1
- package/dist/schemas/short-codes.js +1 -9
- package/dist/schemas/short-codes.js.map +1 -1
- package/dist/schemas/workspace/workspace-search.d.ts +0 -12
- package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-search.js +5 -12
- package/dist/schemas/workspace/workspace-search.js.map +1 -1
- package/dist/state/definition.d.ts +0 -24
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/update-probation.d.ts +1 -1
- package/dist/state/update-probation.d.ts.map +1 -1
- package/dist/state/update-probation.js +1 -1
- package/dist/state/update-probation.js.map +1 -1
- package/dist/state/workspace-state.d.ts +6 -1
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +7 -1
- package/dist/state/workspace-state.js.map +1 -1
- package/package.json +27 -5
- package/src/chores/chores.test.ts +1 -2
- package/src/chores/chores.ts +2 -62
- package/src/chores/index.ts +1 -1
- package/src/chores/prompt.ts +1 -6
- package/src/chores/verdict.test.ts +3 -44
- package/src/contracts/ci.contract.ts +13 -0
- package/src/contracts/device.contract.ts +5 -0
- package/src/contracts/offload.contract.ts +3 -2
- package/src/contracts/secrets.contract.ts +4 -5
- package/src/contracts/workspace.contract.ts +2 -14
- package/src/events/requests.ts +1 -1
- package/src/events/system-events.ts +2 -2
- package/src/ids/project-id.test.ts +26 -0
- package/src/ids/project-id.ts +34 -0
- package/src/ids/tunnel-ids.test.ts +2 -23
- package/src/ids/tunnel-ids.ts +0 -4
- package/src/index.ts +0 -6
- package/src/models/account-moves.ts +6 -6
- package/src/models/model-roles.ts +3 -1
- package/src/models/plan-pools.test.ts +57 -20
- package/src/models/plan-pools.ts +48 -8
- package/src/policy/persona-capability.ts +1 -1
- package/src/protocol/doors/runner-protocol.ts +42 -2
- package/src/protocol/doors/sandbox-pass.test.ts +51 -0
- package/src/protocol/doors/sandbox-pass.ts +119 -0
- package/src/protocol/headers.ts +2 -2
- package/src/protocol/member-reach.test.ts +0 -1
- package/src/protocol/raw/raw-json-routes.ts +14 -2
- package/src/protocol/raw/raw-routes.ts +14 -5
- package/src/protocol/routes.test.ts +0 -4
- package/src/schemas/automations.ts +3 -3
- package/src/schemas/capabilities.ts +0 -6
- package/src/schemas/ci.ts +42 -0
- package/src/schemas/device-files.ts +90 -0
- package/src/schemas/devices.ts +5 -4
- package/src/schemas/hosts.ts +15 -3
- package/src/schemas/issues.ts +54 -0
- package/src/schemas/maintenance.ts +20 -12
- package/src/schemas/metrics.ts +2 -0
- package/src/schemas/offload.ts +39 -2
- package/src/schemas/panels.ts +0 -8
- package/src/schemas/personas.ts +2 -6
- package/src/schemas/providers/plan-limits.ts +7 -1
- package/src/schemas/providers/usage.ts +5 -14
- package/src/schemas/secrets.ts +8 -20
- package/src/schemas/settings-experiments.ts +0 -17
- package/src/schemas/settings-history.ts +3 -0
- package/src/schemas/settings-savings.ts +2 -9
- package/src/schemas/settings.test.ts +16 -9
- package/src/schemas/settings.ts +5 -5
- package/src/schemas/short-codes.ts +2 -14
- package/src/schemas/version-seam.test.ts +2 -2
- package/src/schemas/workspace/workspace-search.ts +12 -25
- package/src/state/update-probation.ts +4 -3
- package/src/state/workspace-state.test.ts +2 -2
- package/src/state/workspace-state.ts +10 -1
- package/src/text/path-refs.test.ts +1 -1
- package/dist/contracts/intentic.contract.d.ts +0 -30
- package/dist/contracts/intentic.contract.d.ts.map +0 -1
- package/dist/contracts/intentic.contract.js +0 -34
- package/dist/contracts/intentic.contract.js.map +0 -1
- package/dist/contracts/inventory.contract.d.ts +0 -138
- package/dist/contracts/inventory.contract.d.ts.map +0 -1
- package/dist/contracts/inventory.contract.js +0 -31
- package/dist/contracts/inventory.contract.js.map +0 -1
- package/dist/schemas/codebase-health.d.ts +0 -56
- package/dist/schemas/codebase-health.d.ts.map +0 -1
- package/dist/schemas/codebase-health.js +0 -43
- package/dist/schemas/codebase-health.js.map +0 -1
- package/dist/schemas/intentic.d.ts +0 -5
- package/dist/schemas/intentic.d.ts.map +0 -1
- package/dist/schemas/intentic.js +0 -3
- package/dist/schemas/intentic.js.map +0 -1
- package/dist/schemas/inventory.d.ts +0 -175
- package/dist/schemas/inventory.d.ts.map +0 -1
- package/dist/schemas/inventory.js +0 -62
- package/dist/schemas/inventory.js.map +0 -1
- package/src/contracts/intentic.contract.ts +0 -45
- package/src/contracts/inventory.contract.ts +0 -35
- package/src/schemas/codebase-health.ts +0 -60
- package/src/schemas/intentic.ts +0 -2
- package/src/schemas/inventory.ts +0 -83
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const HEALTH_LIMIT = 20;
|
|
3
|
-
export declare const WorkspaceHealthQuerySchema: z.ZodObject<{
|
|
4
|
-
repo: z.ZodString;
|
|
5
|
-
since: z.ZodOptional<z.ZodString>;
|
|
6
|
-
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const WorkspaceHotspotSchema: z.ZodObject<{
|
|
9
|
-
path: z.ZodString;
|
|
10
|
-
commits: z.ZodNumber;
|
|
11
|
-
adds: z.ZodNumber;
|
|
12
|
-
dels: z.ZodNumber;
|
|
13
|
-
complexity: z.ZodNumber;
|
|
14
|
-
score: z.ZodNumber;
|
|
15
|
-
latestMs: z.ZodNumber;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
export type WorkspaceHotspot = z.infer<typeof WorkspaceHotspotSchema>;
|
|
18
|
-
export declare const WorkspaceKeyModuleSchema: z.ZodObject<{
|
|
19
|
-
path: z.ZodString;
|
|
20
|
-
exports: z.ZodNumber;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
export type WorkspaceKeyModule = z.infer<typeof WorkspaceKeyModuleSchema>;
|
|
23
|
-
export declare const WorkspaceHealthSchema: z.ZodObject<{
|
|
24
|
-
repo: z.ZodString;
|
|
25
|
-
totals: z.ZodObject<{
|
|
26
|
-
files: z.ZodNumber;
|
|
27
|
-
symbols: z.ZodNumber;
|
|
28
|
-
complexity: z.ZodNumber;
|
|
29
|
-
hotspots: z.ZodNumber;
|
|
30
|
-
}, z.core.$strip>;
|
|
31
|
-
hotspots: z.ZodArray<z.ZodObject<{
|
|
32
|
-
path: z.ZodString;
|
|
33
|
-
commits: z.ZodNumber;
|
|
34
|
-
adds: z.ZodNumber;
|
|
35
|
-
dels: z.ZodNumber;
|
|
36
|
-
complexity: z.ZodNumber;
|
|
37
|
-
score: z.ZodNumber;
|
|
38
|
-
latestMs: z.ZodNumber;
|
|
39
|
-
}, z.core.$strip>>;
|
|
40
|
-
modules: z.ZodArray<z.ZodObject<{
|
|
41
|
-
path: z.ZodString;
|
|
42
|
-
exports: z.ZodNumber;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
freshness: z.ZodObject<{
|
|
45
|
-
state: z.ZodEnum<{
|
|
46
|
-
building: "building";
|
|
47
|
-
fresh: "fresh";
|
|
48
|
-
stale: "stale";
|
|
49
|
-
}>;
|
|
50
|
-
ageMs: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
progress: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
behind: z.ZodOptional<z.ZodNumber>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
export type WorkspaceHealth = z.infer<typeof WorkspaceHealthSchema>;
|
|
56
|
-
//# sourceMappingURL=codebase-health.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codebase-health.d.ts","sourceRoot":"","sources":["../../src/schemas/codebase-health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,0BAA0B;;;;iBAgBrC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;iBASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;iBAAsD,CAAC;AAC5F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { WorkspaceSearchFreshnessSchema } from "./workspace/workspace-search.js";
|
|
3
|
-
export const HEALTH_LIMIT = 20;
|
|
4
|
-
export const WorkspaceHealthQuerySchema = z.object({
|
|
5
|
-
repo: z.string().min(1).describe("Which repository, using the same ids the git routes take."),
|
|
6
|
-
since: z
|
|
7
|
-
.string()
|
|
8
|
-
.max(16)
|
|
9
|
-
.optional()
|
|
10
|
-
.describe("How far back to count changes, written as a span such as 2d, 12h, 1w or 3m. Leave it out for all of history."),
|
|
11
|
-
limit: z.coerce
|
|
12
|
-
.number()
|
|
13
|
-
.int()
|
|
14
|
-
.positive()
|
|
15
|
-
.max(200)
|
|
16
|
-
.optional()
|
|
17
|
-
.describe("How many files and modules to rank. A leaderboard rather than an inventory: past a screenful the ranking stops being the point."),
|
|
18
|
-
});
|
|
19
|
-
export const WorkspaceHotspotSchema = z.object({
|
|
20
|
-
path: z.string(),
|
|
21
|
-
commits: z.number(),
|
|
22
|
-
adds: z.number(),
|
|
23
|
-
dels: z.number(),
|
|
24
|
-
complexity: z.number(),
|
|
25
|
-
score: z.number(),
|
|
26
|
-
latestMs: z.number(),
|
|
27
|
-
});
|
|
28
|
-
export const WorkspaceKeyModuleSchema = z.object({ path: z.string(), exports: z.number() });
|
|
29
|
-
export const WorkspaceHealthSchema = z.object({
|
|
30
|
-
repo: z.string().describe("Which repository this describes."),
|
|
31
|
-
totals: z
|
|
32
|
-
.object({
|
|
33
|
-
files: z.number().describe("Files counted."),
|
|
34
|
-
symbols: z.number().describe("Named things they export."),
|
|
35
|
-
complexity: z.number().describe("Branch points across all of them added up."),
|
|
36
|
-
hotspots: z.number().describe("How many files qualify as hotspots at all. The list below is capped; this is not."),
|
|
37
|
-
})
|
|
38
|
-
.describe("Counts anybody could recount in the files themselves. Deliberately no single maintainability grade: those cannot be checked and are not comparable between projects."),
|
|
39
|
-
hotspots: z.array(WorkspaceHotspotSchema).describe("Files that change often and are complicated at the same time, worst first."),
|
|
40
|
-
modules: z.array(WorkspaceKeyModuleSchema).describe("The parts of the codebase the rest of it leans on most."),
|
|
41
|
-
freshness: WorkspaceSearchFreshnessSchema.describe("Whether the index these numbers were read from is up to date."),
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=codebase-health.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codebase-health.js","sourceRoot":"","sources":["../../src/schemas/codebase-health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AAMjF,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAE/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2DAA2D,CAAC;IAE7F,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CAAC,8GAA8G,CAAC;IAC7H,KAAK,EAAE,CAAC,CAAC,MAAM;SACV,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iIAAiI,CAAC;CACnJ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,CAAC,CAAC,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"}
|
package/dist/schemas/intentic.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intentic.js","sourceRoot":"","sources":["../../src/schemas/intentic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const INVENTORY_PATH = "intent/deploy.config.ts";
|
|
3
|
-
export declare const InventoryProviderSchema: z.ZodEnum<{
|
|
4
|
-
cloudflare: "cloudflare";
|
|
5
|
-
github: "github";
|
|
6
|
-
gitlab: "gitlab";
|
|
7
|
-
host: "host";
|
|
8
|
-
stripe: "stripe";
|
|
9
|
-
}>;
|
|
10
|
-
export type InventoryProvider = z.infer<typeof InventoryProviderSchema>;
|
|
11
|
-
export declare const ServiceKindSchema: z.ZodEnum<{
|
|
12
|
-
infisical: "infisical";
|
|
13
|
-
invoiceninja: "invoiceninja";
|
|
14
|
-
openproject: "openproject";
|
|
15
|
-
outline: "outline";
|
|
16
|
-
paperless: "paperless";
|
|
17
|
-
signoz: "signoz";
|
|
18
|
-
}>;
|
|
19
|
-
export type ServiceKind = z.infer<typeof ServiceKindSchema>;
|
|
20
|
-
export declare const InventoryValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
21
|
-
export declare const INVENTORY_NAME_MAX = 60;
|
|
22
|
-
export declare const INVENTORY_NAME_RE: RegExp;
|
|
23
|
-
export declare const inventoryIdentifier: (raw: string) => string;
|
|
24
|
-
export declare const BackendEntrySchema: z.ZodObject<{
|
|
25
|
-
kind: z.ZodLiteral<"backend">;
|
|
26
|
-
provider: z.ZodEnum<{
|
|
27
|
-
cloudflare: "cloudflare";
|
|
28
|
-
github: "github";
|
|
29
|
-
gitlab: "gitlab";
|
|
30
|
-
host: "host";
|
|
31
|
-
stripe: "stripe";
|
|
32
|
-
}>;
|
|
33
|
-
name: z.ZodString;
|
|
34
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
export declare const ServiceEntrySchema: z.ZodObject<{
|
|
37
|
-
kind: z.ZodLiteral<"service">;
|
|
38
|
-
service: z.ZodEnum<{
|
|
39
|
-
infisical: "infisical";
|
|
40
|
-
invoiceninja: "invoiceninja";
|
|
41
|
-
openproject: "openproject";
|
|
42
|
-
outline: "outline";
|
|
43
|
-
paperless: "paperless";
|
|
44
|
-
signoz: "signoz";
|
|
45
|
-
}>;
|
|
46
|
-
name: z.ZodString;
|
|
47
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
48
|
-
on: z.ZodString;
|
|
49
|
-
expose: z.ZodString;
|
|
50
|
-
}, z.core.$strip>;
|
|
51
|
-
export declare const AppEntrySchema: z.ZodObject<{
|
|
52
|
-
kind: z.ZodLiteral<"app">;
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
55
|
-
on: z.ZodString;
|
|
56
|
-
expose: z.ZodString;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
export declare const InventoryEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
59
|
-
kind: z.ZodLiteral<"backend">;
|
|
60
|
-
provider: z.ZodEnum<{
|
|
61
|
-
cloudflare: "cloudflare";
|
|
62
|
-
github: "github";
|
|
63
|
-
gitlab: "gitlab";
|
|
64
|
-
host: "host";
|
|
65
|
-
stripe: "stripe";
|
|
66
|
-
}>;
|
|
67
|
-
name: z.ZodString;
|
|
68
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
69
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
-
kind: z.ZodLiteral<"service">;
|
|
71
|
-
service: z.ZodEnum<{
|
|
72
|
-
infisical: "infisical";
|
|
73
|
-
invoiceninja: "invoiceninja";
|
|
74
|
-
openproject: "openproject";
|
|
75
|
-
outline: "outline";
|
|
76
|
-
paperless: "paperless";
|
|
77
|
-
signoz: "signoz";
|
|
78
|
-
}>;
|
|
79
|
-
name: z.ZodString;
|
|
80
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
81
|
-
on: z.ZodString;
|
|
82
|
-
expose: z.ZodString;
|
|
83
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
84
|
-
kind: z.ZodLiteral<"app">;
|
|
85
|
-
name: z.ZodString;
|
|
86
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
87
|
-
on: z.ZodString;
|
|
88
|
-
expose: z.ZodString;
|
|
89
|
-
}, z.core.$strip>], "kind">;
|
|
90
|
-
export type InventoryEntry = z.infer<typeof InventoryEntrySchema>;
|
|
91
|
-
export declare const AddInventoryInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
-
kind: z.ZodLiteral<"backend">;
|
|
93
|
-
provider: z.ZodEnum<{
|
|
94
|
-
cloudflare: "cloudflare";
|
|
95
|
-
github: "github";
|
|
96
|
-
gitlab: "gitlab";
|
|
97
|
-
host: "host";
|
|
98
|
-
stripe: "stripe";
|
|
99
|
-
}>;
|
|
100
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
101
|
-
name: z.ZodString;
|
|
102
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
-
kind: z.ZodLiteral<"service">;
|
|
104
|
-
service: z.ZodEnum<{
|
|
105
|
-
infisical: "infisical";
|
|
106
|
-
invoiceninja: "invoiceninja";
|
|
107
|
-
openproject: "openproject";
|
|
108
|
-
outline: "outline";
|
|
109
|
-
paperless: "paperless";
|
|
110
|
-
signoz: "signoz";
|
|
111
|
-
}>;
|
|
112
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
113
|
-
on: z.ZodString;
|
|
114
|
-
expose: z.ZodString;
|
|
115
|
-
name: z.ZodString;
|
|
116
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
-
kind: z.ZodLiteral<"app">;
|
|
118
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
119
|
-
on: z.ZodString;
|
|
120
|
-
expose: z.ZodString;
|
|
121
|
-
name: z.ZodString;
|
|
122
|
-
}, z.core.$strip>], "kind">;
|
|
123
|
-
export type AddInventoryInput = z.infer<typeof AddInventoryInputSchema>;
|
|
124
|
-
export declare const InventoryNameParamSchema: z.ZodObject<{
|
|
125
|
-
name: z.ZodString;
|
|
126
|
-
}, z.core.$strip>;
|
|
127
|
-
export declare const InventoryListSchema: z.ZodObject<{
|
|
128
|
-
entries: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
129
|
-
kind: z.ZodLiteral<"backend">;
|
|
130
|
-
provider: z.ZodEnum<{
|
|
131
|
-
cloudflare: "cloudflare";
|
|
132
|
-
github: "github";
|
|
133
|
-
gitlab: "gitlab";
|
|
134
|
-
host: "host";
|
|
135
|
-
stripe: "stripe";
|
|
136
|
-
}>;
|
|
137
|
-
name: z.ZodString;
|
|
138
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
139
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
-
kind: z.ZodLiteral<"service">;
|
|
141
|
-
service: z.ZodEnum<{
|
|
142
|
-
infisical: "infisical";
|
|
143
|
-
invoiceninja: "invoiceninja";
|
|
144
|
-
openproject: "openproject";
|
|
145
|
-
outline: "outline";
|
|
146
|
-
paperless: "paperless";
|
|
147
|
-
signoz: "signoz";
|
|
148
|
-
}>;
|
|
149
|
-
name: z.ZodString;
|
|
150
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
151
|
-
on: z.ZodString;
|
|
152
|
-
expose: z.ZodString;
|
|
153
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
-
kind: z.ZodLiteral<"app">;
|
|
155
|
-
name: z.ZodString;
|
|
156
|
-
values: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
157
|
-
on: z.ZodString;
|
|
158
|
-
expose: z.ZodString;
|
|
159
|
-
}, z.core.$strip>], "kind">>;
|
|
160
|
-
}, z.core.$strip>;
|
|
161
|
-
export declare const EnrollHostInputSchema: z.ZodObject<{
|
|
162
|
-
name: z.ZodString;
|
|
163
|
-
user: z.ZodString;
|
|
164
|
-
address: z.ZodString;
|
|
165
|
-
port: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
166
|
-
via: z.ZodDefault<z.ZodEnum<{
|
|
167
|
-
cloudflared: "cloudflared";
|
|
168
|
-
direct: "direct";
|
|
169
|
-
}>>;
|
|
170
|
-
sshKey: z.ZodString;
|
|
171
|
-
cfToken: z.ZodOptional<z.ZodString>;
|
|
172
|
-
cfZone: z.ZodOptional<z.ZodString>;
|
|
173
|
-
}, z.core.$strip>;
|
|
174
|
-
export type EnrollHostInput = z.infer<typeof EnrollHostInputSchema>;
|
|
175
|
-
//# sourceMappingURL=inventory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/schemas/inventory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,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from "zod";
|
|
2
|
-
export const INVENTORY_PATH = "intent/deploy.config.ts";
|
|
3
|
-
export const InventoryProviderSchema = z.enum(["host", "cloudflare", "github", "gitlab", "stripe"]);
|
|
4
|
-
export const ServiceKindSchema = z.enum(["signoz", "outline", "paperless", "openproject", "invoiceninja", "infisical"]);
|
|
5
|
-
export const InventoryValuesSchema = z.record(z.string(), z.union([z.string(), z.number()]));
|
|
6
|
-
export const INVENTORY_NAME_MAX = 60;
|
|
7
|
-
export const INVENTORY_NAME_RE = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
8
|
-
const inventoryName = z.string().min(1).max(INVENTORY_NAME_MAX).regex(INVENTORY_NAME_RE);
|
|
9
|
-
export const inventoryIdentifier = (raw) => {
|
|
10
|
-
const cleaned = raw
|
|
11
|
-
.trim()
|
|
12
|
-
.replace(/[^a-zA-Z0-9_]+/gu, "_")
|
|
13
|
-
.replace(/_{2,}/g, "_")
|
|
14
|
-
.replace(/_+$/, "")
|
|
15
|
-
.slice(0, INVENTORY_NAME_MAX);
|
|
16
|
-
if (cleaned === "" || cleaned === "_") {
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
return /^[0-9]/.test(cleaned) ? `_${cleaned}`.slice(0, INVENTORY_NAME_MAX) : cleaned;
|
|
20
|
-
};
|
|
21
|
-
export const BackendEntrySchema = z.object({
|
|
22
|
-
kind: z.literal("backend").describe("Something you already have: a machine, an account with a hosting provider."),
|
|
23
|
-
provider: InventoryProviderSchema.describe("Which provider it is with."),
|
|
24
|
-
name: z.string().describe("What to call it, which is also how everything else refers to it."),
|
|
25
|
-
values: InventoryValuesSchema.describe("Its settings. Anything secret is stored separately and referred to here, never written in."),
|
|
26
|
-
});
|
|
27
|
-
export const ServiceEntrySchema = z.object({
|
|
28
|
-
kind: z.literal("service").describe("Something you want provisioned."),
|
|
29
|
-
service: ServiceKindSchema.describe("Which service."),
|
|
30
|
-
name: z.string().describe("What to call it."),
|
|
31
|
-
values: InventoryValuesSchema.describe("Its settings."),
|
|
32
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
33
|
-
expose: z.string().describe("How it should be reachable."),
|
|
34
|
-
});
|
|
35
|
-
export const AppEntrySchema = z.object({
|
|
36
|
-
kind: z.literal("app").describe("An app of your own, built from source and deployed."),
|
|
37
|
-
name: z.string().describe("What to call it."),
|
|
38
|
-
values: InventoryValuesSchema.describe("Its settings, including the address it should answer on."),
|
|
39
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
40
|
-
expose: z.string().describe("How it should be reachable."),
|
|
41
|
-
});
|
|
42
|
-
export const InventoryEntrySchema = z.discriminatedUnion("kind", [BackendEntrySchema, ServiceEntrySchema, AppEntrySchema]);
|
|
43
|
-
export const AddInventoryInputSchema = z.discriminatedUnion("kind", [
|
|
44
|
-
BackendEntrySchema.extend({ name: inventoryName }),
|
|
45
|
-
ServiceEntrySchema.extend({ name: inventoryName }),
|
|
46
|
-
AppEntrySchema.extend({ name: inventoryName }),
|
|
47
|
-
]);
|
|
48
|
-
export const InventoryNameParamSchema = z.object({ name: z.string().describe("Which entry, by name.") });
|
|
49
|
-
export const InventoryListSchema = z.object({
|
|
50
|
-
entries: z.array(InventoryEntrySchema).describe("Everything declared: what you have, and what you want provisioned."),
|
|
51
|
-
});
|
|
52
|
-
export const EnrollHostInputSchema = z.object({
|
|
53
|
-
name: inventoryName,
|
|
54
|
-
user: z.string().min(1),
|
|
55
|
-
address: z.string().min(1),
|
|
56
|
-
port: z.coerce.number().default(22),
|
|
57
|
-
via: z.enum(["direct", "cloudflared"]).default("cloudflared"),
|
|
58
|
-
sshKey: z.string().min(1),
|
|
59
|
-
cfToken: z.string().optional(),
|
|
60
|
-
cfZone: z.string().optional(),
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=inventory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/schemas/inventory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE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C,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC7D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { procedure } from "../protocol/route-meta.js";
|
|
2
|
-
import { streamOf } from "../protocol/routes.js";
|
|
3
|
-
import { IntenticLineSchema } from "../events/system-events.js";
|
|
4
|
-
import { IntenticRunSchema } from "../schemas/intentic.js";
|
|
5
|
-
import { OkSchema } from "../schemas/shared.js";
|
|
6
|
-
|
|
7
|
-
// Run the in-sandbox intentic CLI (resolve/plan/apply/deployments/…) and stream its ndjson lines as they
|
|
8
|
-
// arrive, so the UI sees live progress. A non-zero exit surfaces as a thrown error once the stream ends.
|
|
9
|
-
export const intenticContract = {
|
|
10
|
-
run: procedure
|
|
11
|
-
.route({
|
|
12
|
-
method: "POST",
|
|
13
|
-
path: "/intentic",
|
|
14
|
-
summary: "Run an infrastructure command",
|
|
15
|
-
description:
|
|
16
|
-
"Runs the sandbox's own command-line tool and streams its output as it arrives, so progress is visible rather than arriving all at once at the end. A failure surfaces once the stream closes.",
|
|
17
|
-
})
|
|
18
|
-
.input(IntenticRunSchema)
|
|
19
|
-
.output(streamOf(IntenticLineSchema)),
|
|
20
|
-
// Launch the minutes-long apply → adopt reconcile as a one-shot tmux job (session panel-infra-apply) and
|
|
21
|
-
// return immediately, progress is followed by attaching the terminal, not by holding this request open.
|
|
22
|
-
apply: procedure
|
|
23
|
-
.route({
|
|
24
|
-
method: "POST",
|
|
25
|
-
path: "/intentic/apply",
|
|
26
|
-
summary: "Bring the infrastructure into line",
|
|
27
|
-
description:
|
|
28
|
-
"Starts the long reconcile that makes the running world match what was declared, and answers immediately. It takes minutes, so it runs in a terminal you attach to rather than on a held-open request.",
|
|
29
|
-
})
|
|
30
|
-
.output(OkSchema),
|
|
31
|
-
// Tail the running (or just-finished) apply's structured event stream, the same ndjson lines the tmux pane
|
|
32
|
-
// renders as text, persisted to a durable file so the UI shows per-resource progress that survives a page
|
|
33
|
-
// refresh. Replays from the run's {kind:"start"} then follows live, closing on {kind:"exit"}. GET, like
|
|
34
|
-
// /events, because it takes no input; reuses the loose IntenticLine shape so no new schema is needed.
|
|
35
|
-
applyEvents: procedure
|
|
36
|
-
.route({
|
|
37
|
-
method: "GET",
|
|
38
|
-
path: "/intentic/apply/events",
|
|
39
|
-
summary: "Follow the reconcile",
|
|
40
|
-
description:
|
|
41
|
-
"The same progress the terminal shows, as structured events, kept on disk so a page refresh does not lose it. It replays from the start of the run and then follows live, closing when the run ends.",
|
|
42
|
-
})
|
|
43
|
-
.meta({ stream: true })
|
|
44
|
-
.output(streamOf(IntenticLineSchema)),
|
|
45
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { procedure } from "../protocol/route-meta.js";
|
|
2
|
-
import { AddInventoryInputSchema, InventoryListSchema, InventoryNameParamSchema } from "../schemas/inventory.js";
|
|
3
|
-
|
|
4
|
-
// The i.have.* / i.want.service entries in deploy.config.ts's managed region. add/remove rewrite the region and
|
|
5
|
-
// commit it (mirroring an agent edit) and return the full updated list so the UI re-renders from one response.
|
|
6
|
-
// Deploy-target hosts self-register out-of-band via the daemon's plain /enroll route (connect-host script).
|
|
7
|
-
export const inventoryContract = {
|
|
8
|
-
list: procedure
|
|
9
|
-
.route({
|
|
10
|
-
method: "GET",
|
|
11
|
-
path: "/inventory",
|
|
12
|
-
summary: "Machines and services you have declared",
|
|
13
|
-
description: "What the deployment configuration says this setup owns and what it wants provisioned.",
|
|
14
|
-
})
|
|
15
|
-
.output(InventoryListSchema),
|
|
16
|
-
add: procedure
|
|
17
|
-
.route({
|
|
18
|
-
method: "POST",
|
|
19
|
-
path: "/inventory",
|
|
20
|
-
summary: "Declare a machine or service",
|
|
21
|
-
description:
|
|
22
|
-
"Writes the entry into the configuration file and commits it, exactly as an agent editing that file by hand would. Answers with the whole updated list, so a screen redraws from one response.",
|
|
23
|
-
})
|
|
24
|
-
.input(AddInventoryInputSchema)
|
|
25
|
-
.output(InventoryListSchema),
|
|
26
|
-
remove: procedure
|
|
27
|
-
.route({
|
|
28
|
-
method: "DELETE",
|
|
29
|
-
path: "/inventory/{name}",
|
|
30
|
-
summary: "Undeclare a machine or service",
|
|
31
|
-
description: "Takes the entry back out of the configuration and commits that too. Answers with the whole updated list.",
|
|
32
|
-
})
|
|
33
|
-
.input(InventoryNameParamSchema)
|
|
34
|
-
.output(InventoryListSchema),
|
|
35
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// codebase health: one repository's structure and risk, in numbers
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { WorkspaceSearchFreshnessSchema } from "./workspace/workspace-search.js";
|
|
4
|
-
// Repo-level companion to the management panel and git-history graph: the resident engine's `hotspots` (churn ×
|
|
5
|
-
// complexity) and `map` (PageRank over imports) verbs, as figures a panel can plot. Every field is a recountable count;
|
|
6
|
-
// no composite maintainability grade, since those aren't comparable across projects or checkable. HEALTH_LIMIT is how
|
|
7
|
-
// many hotspot files and key modules a report carries by default: a leaderboard, not an inventory, since past a
|
|
8
|
-
// screenful the reader should be reading the files instead.
|
|
9
|
-
export const HEALTH_LIMIT = 20;
|
|
10
|
-
export const WorkspaceHealthQuerySchema = z.object({
|
|
11
|
-
// "root" (the /work repo) or a nested repo's root-relative dir, the same {repo} ids the git routes take.
|
|
12
|
-
repo: z.string().min(1).describe("Which repository, using the same ids the git routes take."),
|
|
13
|
-
// Churn window (2d, 12h, 1w, 3m). Absent = all of history, which is what a hotspot ranking wants by default.
|
|
14
|
-
since: z
|
|
15
|
-
.string()
|
|
16
|
-
.max(16)
|
|
17
|
-
.optional()
|
|
18
|
-
.describe("How far back to count changes, written as a span such as 2d, 12h, 1w or 3m. Leave it out for all of history."),
|
|
19
|
-
limit: z.coerce
|
|
20
|
-
.number()
|
|
21
|
-
.int()
|
|
22
|
-
.positive()
|
|
23
|
-
.max(200)
|
|
24
|
-
.optional()
|
|
25
|
-
.describe("How many files and modules to rank. A leaderboard rather than an inventory: past a screenful the ranking stops being the point."),
|
|
26
|
-
});
|
|
27
|
-
// A file both churning and tangled; `score` is the ranking product, carried explicitly so the panel plots what it ranks
|
|
28
|
-
// by rather than recomputing it.
|
|
29
|
-
export const WorkspaceHotspotSchema = z.object({
|
|
30
|
-
path: z.string(),
|
|
31
|
-
commits: z.number(),
|
|
32
|
-
adds: z.number(),
|
|
33
|
-
dels: z.number(),
|
|
34
|
-
complexity: z.number(),
|
|
35
|
-
score: z.number(),
|
|
36
|
-
// Epoch ms of the latest commit touching the file, within the window.
|
|
37
|
-
latestMs: z.number(),
|
|
38
|
-
});
|
|
39
|
-
export type WorkspaceHotspot = z.infer<typeof WorkspaceHotspotSchema>;
|
|
40
|
-
// A file of the import graph's ranked skeleton, order IS the rank, so no rank number rides along.
|
|
41
|
-
export const WorkspaceKeyModuleSchema = z.object({ path: z.string(), exports: z.number() });
|
|
42
|
-
export type WorkspaceKeyModule = z.infer<typeof WorkspaceKeyModuleSchema>;
|
|
43
|
-
export const WorkspaceHealthSchema = z.object({
|
|
44
|
-
repo: z.string().describe("Which repository this describes."),
|
|
45
|
-
totals: z
|
|
46
|
-
.object({
|
|
47
|
-
files: z.number().describe("Files counted."),
|
|
48
|
-
symbols: z.number().describe("Named things they export."),
|
|
49
|
-
complexity: z.number().describe("Branch points across all of them added up."),
|
|
50
|
-
hotspots: z.number().describe("How many files qualify as hotspots at all. The list below is capped; this is not."),
|
|
51
|
-
})
|
|
52
|
-
.describe(
|
|
53
|
-
"Counts anybody could recount in the files themselves. Deliberately no single maintainability grade: those cannot be checked and are not comparable between projects.",
|
|
54
|
-
),
|
|
55
|
-
hotspots: z.array(WorkspaceHotspotSchema).describe("Files that change often and are complicated at the same time, worst first."),
|
|
56
|
-
modules: z.array(WorkspaceKeyModuleSchema).describe("The parts of the codebase the rest of it leans on most."),
|
|
57
|
-
// Same index-freshness signal the search route reports: a panel drawn off a half-built index says so.
|
|
58
|
-
freshness: WorkspaceSearchFreshnessSchema.describe("Whether the index these numbers were read from is up to date."),
|
|
59
|
-
});
|
|
60
|
-
export type WorkspaceHealth = z.infer<typeof WorkspaceHealthSchema>;
|
package/src/schemas/intentic.ts
DELETED
package/src/schemas/inventory.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// inventory: the i.have.* / i.want.service entries in deploy.config.ts's managed region
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
// The daemon renders/parses these; the browser edits them through the inventory routes.
|
|
4
|
-
|
|
5
|
-
// Where the inventory lives, workspace-root-relative: the space the daemon's workspaceChanged paths arrive in.
|
|
6
|
-
export const INVENTORY_PATH = "intent/deploy.config.ts";
|
|
7
|
-
|
|
8
|
-
export const InventoryProviderSchema = z.enum(["host", "cloudflare", "github", "gitlab", "stripe"]);
|
|
9
|
-
export type InventoryProvider = z.infer<typeof InventoryProviderSchema>;
|
|
10
|
-
export const ServiceKindSchema = z.enum(["signoz", "outline", "paperless", "openproject", "invoiceninja", "infisical"]);
|
|
11
|
-
export type ServiceKind = z.infer<typeof ServiceKindSchema>;
|
|
12
|
-
// Non-secret option values; secret options (sshKey, apiToken, apiKey) are emitted as env() references, never sent over
|
|
13
|
-
// the wire.
|
|
14
|
-
export const InventoryValuesSchema = z.record(z.string(), z.union([z.string(), z.number()]));
|
|
15
|
-
// `const <name>` binding in deploy.config.ts, so it must be a valid identifier.
|
|
16
|
-
export const INVENTORY_NAME_MAX = 60;
|
|
17
|
-
export const INVENTORY_NAME_RE = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
18
|
-
const inventoryName = z.string().min(1).max(INVENTORY_NAME_MAX).regex(INVENTORY_NAME_RE);
|
|
19
|
-
|
|
20
|
-
// Repairs a name into the identifier the rule above demands, so a form can offer one rather than refuse what it
|
|
21
|
-
// pre-filled: app directories are `web-app`, and `const web-app` is not a binding. Empty means nothing was salvageable.
|
|
22
|
-
export const inventoryIdentifier = (raw: string): string => {
|
|
23
|
-
const cleaned = raw
|
|
24
|
-
.trim()
|
|
25
|
-
.replace(/[^a-zA-Z0-9_]+/gu, "_")
|
|
26
|
-
.replace(/_{2,}/g, "_")
|
|
27
|
-
.replace(/_+$/, "")
|
|
28
|
-
.slice(0, INVENTORY_NAME_MAX);
|
|
29
|
-
if (cleaned === "" || cleaned === "_") {
|
|
30
|
-
return "";
|
|
31
|
-
}
|
|
32
|
-
// A leading digit is the one repair that has to add rather than remove.
|
|
33
|
-
return /^[0-9]/.test(cleaned) ? `_${cleaned}`.slice(0, INVENTORY_NAME_MAX) : cleaned;
|
|
34
|
-
};
|
|
35
|
-
export const BackendEntrySchema = z.object({
|
|
36
|
-
kind: z.literal("backend").describe("Something you already have: a machine, an account with a hosting provider."),
|
|
37
|
-
provider: InventoryProviderSchema.describe("Which provider it is with."),
|
|
38
|
-
name: z.string().describe("What to call it, which is also how everything else refers to it."),
|
|
39
|
-
values: InventoryValuesSchema.describe("Its settings. Anything secret is stored separately and referred to here, never written in."),
|
|
40
|
-
});
|
|
41
|
-
export const ServiceEntrySchema = z.object({
|
|
42
|
-
kind: z.literal("service").describe("Something you want provisioned."),
|
|
43
|
-
service: ServiceKindSchema.describe("Which service."),
|
|
44
|
-
name: z.string().describe("What to call it."),
|
|
45
|
-
values: InventoryValuesSchema.describe("Its settings."),
|
|
46
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
47
|
-
expose: z.string().describe("How it should be reachable."),
|
|
48
|
-
});
|
|
49
|
-
// i.want.app: single production environment on `main`; `values.domain` is where it's exposed. Multi-env/teams wiring is
|
|
50
|
-
// hand-authored outside the managed region.
|
|
51
|
-
export const AppEntrySchema = z.object({
|
|
52
|
-
kind: z.literal("app").describe("An app of your own, built from source and deployed."),
|
|
53
|
-
name: z.string().describe("What to call it."),
|
|
54
|
-
values: InventoryValuesSchema.describe("Its settings, including the address it should answer on."),
|
|
55
|
-
on: z.string().describe("Which of your machines to put it on."),
|
|
56
|
-
expose: z.string().describe("How it should be reachable."),
|
|
57
|
-
});
|
|
58
|
-
export const InventoryEntrySchema = z.discriminatedUnion("kind", [BackendEntrySchema, ServiceEntrySchema, AppEntrySchema]);
|
|
59
|
-
export type InventoryEntry = z.infer<typeof InventoryEntrySchema>;
|
|
60
|
-
export const AddInventoryInputSchema = z.discriminatedUnion("kind", [
|
|
61
|
-
BackendEntrySchema.extend({ name: inventoryName }),
|
|
62
|
-
ServiceEntrySchema.extend({ name: inventoryName }),
|
|
63
|
-
AppEntrySchema.extend({ name: inventoryName }),
|
|
64
|
-
]);
|
|
65
|
-
export type AddInventoryInput = z.infer<typeof AddInventoryInputSchema>;
|
|
66
|
-
export const InventoryNameParamSchema = z.object({ name: z.string().describe("Which entry, by name.") });
|
|
67
|
-
export const InventoryListSchema = z.object({
|
|
68
|
-
entries: z.array(InventoryEntrySchema).describe("Everything declared: what you have, and what you want provisioned."),
|
|
69
|
-
});
|
|
70
|
-
// A deploy-target host self-registering via POST /enroll (connect-token auth); the SSH key (+ optional Cloudflare
|
|
71
|
-
// token) is written to desired-state/.env, and upserted into inventory.
|
|
72
|
-
export const EnrollHostInputSchema = z.object({
|
|
73
|
-
name: inventoryName,
|
|
74
|
-
user: z.string().min(1),
|
|
75
|
-
address: z.string().min(1),
|
|
76
|
-
port: z.coerce.number().default(22),
|
|
77
|
-
via: z.enum(["direct", "cloudflared"]).default("cloudflared"),
|
|
78
|
-
sshKey: z.string().min(1),
|
|
79
|
-
cfToken: z.string().optional(),
|
|
80
|
-
// Resolved alongside cfToken; avoids re-discovery and lets Add-service offer `<subdomain>.<zone>`.
|
|
81
|
-
cfZone: z.string().optional(),
|
|
82
|
-
});
|
|
83
|
-
export type EnrollHostInput = z.infer<typeof EnrollHostInputSchema>;
|