@dual-os/cli 0.0.0-stage → 0.11.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 +4 -0
- package/README.md +15 -2
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/credentials.d.ts +17 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +57 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/destination.d.ts +22 -0
- package/dist/auth/destination.d.ts.map +1 -0
- package/dist/auth/destination.js +49 -0
- package/dist/auth/destination.js.map +1 -0
- package/dist/auth/http.d.ts +12 -0
- package/dist/auth/http.d.ts.map +1 -0
- package/dist/auth/http.js +34 -0
- package/dist/auth/http.js.map +1 -0
- package/dist/auth/login.d.ts +22 -0
- package/dist/auth/login.d.ts.map +1 -0
- package/dist/auth/login.js +98 -0
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/protocol.d.ts +26 -0
- package/dist/auth/protocol.d.ts.map +1 -0
- package/dist/auth/protocol.js +31 -0
- package/dist/auth/protocol.js.map +1 -0
- package/dist/baseline.d.ts +18 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +22 -0
- package/dist/baseline.js.map +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +492 -0
- package/dist/cli.js.map +1 -0
- package/dist/create/choices.d.ts +58 -0
- package/dist/create/choices.d.ts.map +1 -0
- package/dist/create/choices.js +121 -0
- package/dist/create/choices.js.map +1 -0
- package/dist/create/deployment.d.ts +48 -0
- package/dist/create/deployment.d.ts.map +1 -0
- package/dist/create/deployment.js +66 -0
- package/dist/create/deployment.js.map +1 -0
- package/dist/create/scaffold.d.ts +57 -0
- package/dist/create/scaffold.d.ts.map +1 -0
- package/dist/create/scaffold.js +198 -0
- package/dist/create/scaffold.js.map +1 -0
- package/dist/create/source-reference.d.ts +39 -0
- package/dist/create/source-reference.d.ts.map +1 -0
- package/dist/create/source-reference.js +185 -0
- package/dist/create/source-reference.js.map +1 -0
- package/dist/create/template.d.ts +116 -0
- package/dist/create/template.d.ts.map +1 -0
- package/dist/create/template.js +211 -0
- package/dist/create/template.js.map +1 -0
- package/dist/diagnostics.d.ts +6 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +18 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/help.d.ts +16 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +73 -0
- package/dist/help.js.map +1 -0
- package/dist/openapi/bundle.d.ts +18 -0
- package/dist/openapi/bundle.d.ts.map +1 -0
- package/dist/openapi/bundle.js +201 -0
- package/dist/openapi/bundle.js.map +1 -0
- package/dist/openapi/discovery.d.ts +30 -0
- package/dist/openapi/discovery.d.ts.map +1 -0
- package/dist/openapi/discovery.js +325 -0
- package/dist/openapi/discovery.js.map +1 -0
- package/dist/openapi/emit.d.ts +52 -0
- package/dist/openapi/emit.d.ts.map +1 -0
- package/dist/openapi/emit.js +596 -0
- package/dist/openapi/emit.js.map +1 -0
- package/dist/openapi/graphql.d.ts +102 -0
- package/dist/openapi/graphql.d.ts.map +1 -0
- package/dist/openapi/graphql.js +294 -0
- package/dist/openapi/graphql.js.map +1 -0
- package/dist/openapi/identity.d.ts +88 -0
- package/dist/openapi/identity.d.ts.map +1 -0
- package/dist/openapi/identity.js +98 -0
- package/dist/openapi/identity.js.map +1 -0
- package/dist/openapi/mcp.d.ts +21 -0
- package/dist/openapi/mcp.d.ts.map +1 -0
- package/dist/openapi/mcp.js +133 -0
- package/dist/openapi/mcp.js.map +1 -0
- package/dist/openapi/operations.d.ts +165 -0
- package/dist/openapi/operations.d.ts.map +1 -0
- package/dist/openapi/operations.js +361 -0
- package/dist/openapi/operations.js.map +1 -0
- package/dist/openapi/overlay.d.ts +23 -0
- package/dist/openapi/overlay.d.ts.map +1 -0
- package/dist/openapi/overlay.js +115 -0
- package/dist/openapi/overlay.js.map +1 -0
- package/dist/openapi/plugin.d.ts +83 -0
- package/dist/openapi/plugin.d.ts.map +1 -0
- package/dist/openapi/plugin.js +468 -0
- package/dist/openapi/plugin.js.map +1 -0
- package/dist/openapi/polymorphism.d.ts +21 -0
- package/dist/openapi/polymorphism.d.ts.map +1 -0
- package/dist/openapi/polymorphism.js +96 -0
- package/dist/openapi/polymorphism.js.map +1 -0
- package/dist/openapi/postman.d.ts +21 -0
- package/dist/openapi/postman.d.ts.map +1 -0
- package/dist/openapi/postman.js +286 -0
- package/dist/openapi/postman.js.map +1 -0
- package/dist/openapi/schema.d.ts +178 -0
- package/dist/openapi/schema.d.ts.map +1 -0
- package/dist/openapi/schema.js +1234 -0
- package/dist/openapi/schema.js.map +1 -0
- package/dist/openapi/select.d.ts +22 -0
- package/dist/openapi/select.d.ts.map +1 -0
- package/dist/openapi/select.js +79 -0
- package/dist/openapi/select.js.map +1 -0
- package/dist/openapi/spec.d.ts +147 -0
- package/dist/openapi/spec.d.ts.map +1 -0
- package/dist/openapi/spec.js +263 -0
- package/dist/openapi/spec.js.map +1 -0
- package/dist/openapi/swagger.d.ts +166 -0
- package/dist/openapi/swagger.d.ts.map +1 -0
- package/dist/openapi/swagger.js +298 -0
- package/dist/openapi/swagger.js.map +1 -0
- package/dist/openapi/versions.d.ts +52 -0
- package/dist/openapi/versions.d.ts.map +1 -0
- package/dist/openapi/versions.js +120 -0
- package/dist/openapi/versions.js.map +1 -0
- package/dist/plugin/archive.d.ts +27 -0
- package/dist/plugin/archive.d.ts.map +1 -0
- package/dist/plugin/archive.js +170 -0
- package/dist/plugin/archive.js.map +1 -0
- package/dist/plugin/bundle.d.ts +27 -0
- package/dist/plugin/bundle.d.ts.map +1 -0
- package/dist/plugin/bundle.js +328 -0
- package/dist/plugin/bundle.js.map +1 -0
- package/dist/plugin/init.d.ts +18 -0
- package/dist/plugin/init.d.ts.map +1 -0
- package/dist/plugin/init.js +121 -0
- package/dist/plugin/init.js.map +1 -0
- package/dist/plugin/inspection.d.ts +24 -0
- package/dist/plugin/inspection.d.ts.map +1 -0
- package/dist/plugin/inspection.js +24 -0
- package/dist/plugin/inspection.js.map +1 -0
- package/dist/plugin/package.d.ts +26 -0
- package/dist/plugin/package.d.ts.map +1 -0
- package/dist/plugin/package.js +73 -0
- package/dist/plugin/package.js.map +1 -0
- package/dist/plugin/publication.d.ts +29 -0
- package/dist/plugin/publication.d.ts.map +1 -0
- package/dist/plugin/publication.js +65 -0
- package/dist/plugin/publication.js.map +1 -0
- package/dist/plugin/validation.d.ts +15 -0
- package/dist/plugin/validation.d.ts.map +1 -0
- package/dist/plugin/validation.js +119 -0
- package/dist/plugin/validation.js.map +1 -0
- package/dist/release/archives.d.ts +33 -0
- package/dist/release/archives.d.ts.map +1 -0
- package/dist/release/archives.js +81 -0
- package/dist/release/archives.js.map +1 -0
- package/dist/release/release-manifest.d.ts +182 -0
- package/dist/release/release-manifest.d.ts.map +1 -0
- package/dist/release/release-manifest.js +79 -0
- package/dist/release/release-manifest.js.map +1 -0
- package/dist/release/releases.d.ts +36 -0
- package/dist/release/releases.d.ts.map +1 -0
- package/dist/release/releases.js +122 -0
- package/dist/release/releases.js.map +1 -0
- package/dist/skills.d.ts +35 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +257 -0
- package/dist/skills.js.map +1 -0
- package/package.json +73 -4
- package/skills/dual-fde/SKILL.md +38 -0
- package/skills/dual-fde/references/access.md +62 -0
- package/skills/dual-fde/references/author-plugins.md +54 -0
- package/skills/dual-fde/references/cli.md +97 -0
- package/skills/dual-fde/references/manage-plugins.md +78 -0
- package/skills/dual-fde/references/migrations-deployment.md +84 -0
- package/skills/dual-fde/references/openapi-plugins.md +47 -0
- package/skills/dual-fde/references/sdk-docs.md +56 -0
- package/skills/dual-fde/references/upgrades.md +115 -0
- package/skills/dual-fde/references/working-context.md +69 -0
- package/src/auth/credentials.ts +84 -0
- package/src/auth/destination.ts +83 -0
- package/src/auth/http.ts +39 -0
- package/src/auth/login.ts +177 -0
- package/src/auth/protocol.ts +37 -0
- package/src/baseline.ts +15 -0
- package/src/bin.ts +4 -0
- package/src/cli.ts +969 -0
- package/src/create/choices.ts +177 -0
- package/src/create/deployment.ts +96 -0
- package/src/create/scaffold.ts +334 -0
- package/src/create/source-reference.ts +212 -0
- package/src/create/template.ts +300 -0
- package/src/diagnostics.ts +8 -0
- package/src/help.ts +142 -0
- package/src/openapi/bundle.ts +290 -0
- package/src/openapi/discovery.ts +438 -0
- package/src/openapi/emit.ts +1031 -0
- package/src/openapi/graphql.ts +375 -0
- package/src/openapi/identity.ts +153 -0
- package/src/openapi/mcp.ts +165 -0
- package/src/openapi/operations.ts +781 -0
- package/src/openapi/overlay.ts +195 -0
- package/src/openapi/plugin.ts +856 -0
- package/src/openapi/polymorphism.ts +207 -0
- package/src/openapi/postman.ts +403 -0
- package/src/openapi/schema.ts +2138 -0
- package/src/openapi/select.ts +113 -0
- package/src/openapi/spec.ts +401 -0
- package/src/openapi/swagger.ts +422 -0
- package/src/openapi/versions.ts +174 -0
- package/src/plugin/archive.ts +244 -0
- package/src/plugin/bundle.ts +572 -0
- package/src/plugin/init.ts +178 -0
- package/src/plugin/inspection.ts +19 -0
- package/src/plugin/package.ts +140 -0
- package/src/plugin/publication.ts +128 -0
- package/src/plugin/validation.ts +213 -0
- package/src/release/archives.ts +133 -0
- package/src/release/release-manifest.ts +79 -0
- package/src/release/releases.ts +210 -0
- package/src/skills.ts +434 -0
- package/templates/compose/.env.compose.example.hbs +3 -0
- package/templates/compose/.env.host.example.hbs +4 -0
- package/templates/compose/Dockerfile.hbs +12 -0
- package/templates/compose/OPERATIONS.md.hbs +159 -0
- package/templates/compose/_dockerignore +14 -0
- package/templates/compose/compose.external.yaml +7 -0
- package/templates/compose/compose.host-linux.yaml +5 -0
- package/templates/compose/compose.host.yaml.hbs +15 -0
- package/templates/compose/compose.yaml.hbs +85 -0
- package/templates/compose/release.env.hbs +2 -0
- package/templates/default/.env.example.hbs +79 -0
- package/templates/default/README.md.hbs +150 -0
- package/templates/default/_gitignore +11 -0
- package/templates/default/packages/customer-plugin/src/Customer.ts.hbs +17 -0
- package/templates/default/packages/customer-plugin/tsconfig.json +15 -0
- package/templates/default/packages/execution-layer/src/App.ts.hbs +7 -0
- package/templates/default/packages/execution-layer/src/Host.ts.hbs +31 -0
- package/templates/default/packages/execution-layer/src/Telemetry.ts.hbs +23 -0
- package/templates/default/packages/execution-layer/src/api.ts.hbs +21 -0
- package/templates/default/packages/execution-layer/src/bootstrap.ts +22 -0
- package/templates/default/packages/execution-layer/src/migrate.ts +11 -0
- package/templates/default/packages/execution-layer/src/registry-check.ts +29 -0
- package/templates/default/packages/execution-layer/src/registry-sync.ts +14 -0
- package/templates/default/packages/execution-layer/src/worker.ts.hbs +16 -0
- package/templates/default/packages/execution-layer/test/app.host-test.ts.hbs +58 -0
- package/templates/default/packages/execution-layer/test/app.test.ts.hbs +16 -0
- package/templates/default/tsconfig.json +5 -0
- package/templates/default/vitest.config.ts +5 -0
- package/templates/default/vitest.host.config.ts +6 -0
- package/templates/opensandbox/OPEN-SANDBOX.md +25 -0
- package/templates/opensandbox/docker/agent-sandbox.Dockerfile +41 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { Host } from "./choices.js";
|
|
3
|
+
import { Image, Pair, Selection } from "./deployment.js";
|
|
4
|
+
import { Service as Service$1 } from "../release/archives.js";
|
|
5
|
+
import { Selector, Service as Service$2, Version } from "../release/releases.js";
|
|
6
|
+
import { Service as Service$3, files, layer as layer$1 } from "./source-reference.js";
|
|
7
|
+
import { Replay, files as files$1, record, revision } from "./template.js";
|
|
8
|
+
import "./scaffold.js";
|
|
9
|
+
import { Array, Context, Effect, Layer, Record, Redacted, Schema, Stream, String } from "effect";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
12
|
+
import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
13
|
+
import { dirname, join, resolve } from "node:path";
|
|
14
|
+
// src/create/scaffold.ts
|
|
15
|
+
var scaffold_exports = /* @__PURE__ */ __exportAll({
|
|
16
|
+
Request: () => Request,
|
|
17
|
+
Scaffold: () => scaffold_exports,
|
|
18
|
+
ScaffoldError: () => ScaffoldError,
|
|
19
|
+
Service: () => Service,
|
|
20
|
+
layer: () => layer
|
|
21
|
+
});
|
|
22
|
+
const Request = Schema.Struct({
|
|
23
|
+
bare: Schema.Boolean,
|
|
24
|
+
cliVersion: Schema.NonEmptyString,
|
|
25
|
+
destination: Schema.NonEmptyString.check(Schema.isPattern(/^[^\p{Cc}]+$/u), Schema.isPattern(/\S/, { message: "Destination must not be blank" })),
|
|
26
|
+
host: Host,
|
|
27
|
+
manifest: Schema.optional(Version),
|
|
28
|
+
release: Schema.optional(Selector),
|
|
29
|
+
releasePair: Schema.optional(Schema.NonEmptyString),
|
|
30
|
+
replay: Schema.optional(Schema.NonEmptyString),
|
|
31
|
+
skipInstall: Schema.Boolean,
|
|
32
|
+
webImage: Schema.optional(Image)
|
|
33
|
+
});
|
|
34
|
+
var ScaffoldError = class extends Schema.TaggedError()("ScaffoldError", {
|
|
35
|
+
cause: Schema.Redacted(Schema.Defect()),
|
|
36
|
+
operation: Schema.Literals([
|
|
37
|
+
"options",
|
|
38
|
+
"replay",
|
|
39
|
+
"destination",
|
|
40
|
+
"access",
|
|
41
|
+
"write",
|
|
42
|
+
"install",
|
|
43
|
+
"pair"
|
|
44
|
+
])
|
|
45
|
+
}) {};
|
|
46
|
+
const failure = (operation, cause) => new ScaffoldError({
|
|
47
|
+
cause: Redacted.make(cause),
|
|
48
|
+
operation
|
|
49
|
+
});
|
|
50
|
+
const attempt = (operation, run) => Effect.tryPromise({
|
|
51
|
+
catch: (cause) => failure(operation, cause),
|
|
52
|
+
try: run
|
|
53
|
+
}).pipe(Effect.uninterruptible);
|
|
54
|
+
const FileError = Schema.Struct({ code: Schema.String });
|
|
55
|
+
const isMissing = Schema.is(FileError.check(Schema.makeFilter((error) => error.code === "ENOENT")));
|
|
56
|
+
const emptyDestination = Effect.fn("Scaffold.emptyDestination")(function* (destination) {
|
|
57
|
+
const stat = yield* Effect.tryPromise(() => lstat(destination)).pipe(Effect.catchIf((cause) => isMissing(cause.cause), () => Effect.void), Effect.mapError((cause) => failure("destination", cause.cause)), Effect.uninterruptible);
|
|
58
|
+
if (stat === void 0) return;
|
|
59
|
+
if (!stat.isDirectory() || Array.isArrayNonEmpty(yield* attempt("destination", () => readdir(destination)))) return yield* failure("destination", /* @__PURE__ */ new Error("Destination must be absent or an empty directory, not a symlink"));
|
|
60
|
+
});
|
|
61
|
+
var Service = class extends Context.Service()("@dual-os/cli/Scaffold") {};
|
|
62
|
+
const layer = Layer.effect(Service, Effect.gen(function* () {
|
|
63
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
64
|
+
const archives = yield* Service$1;
|
|
65
|
+
const sourceReference = yield* Service$3;
|
|
66
|
+
const releases = yield* Service$2;
|
|
67
|
+
const probeVersions = Effect.fn("Scaffold.probeVersions")(function* (cwd, versions) {
|
|
68
|
+
for (const [name, version] of Record.toEntries(versions)) {
|
|
69
|
+
if (!String.startsWith("@dual/")(name) && name !== "@dual-os/sdk") continue;
|
|
70
|
+
yield* Effect.scoped(Effect.gen(function* () {
|
|
71
|
+
const handle = yield* spawner.spawn(ChildProcess.make("bun", [
|
|
72
|
+
"info",
|
|
73
|
+
`${name}@${version}`,
|
|
74
|
+
"version",
|
|
75
|
+
"--json",
|
|
76
|
+
"--no-cache"
|
|
77
|
+
], {
|
|
78
|
+
cwd,
|
|
79
|
+
stderr: "ignore",
|
|
80
|
+
stdin: "ignore",
|
|
81
|
+
stdout: "pipe"
|
|
82
|
+
}));
|
|
83
|
+
const output = yield* Stream.mkString(Stream.decodeText(handle.stdout));
|
|
84
|
+
const code = yield* handle.exitCode;
|
|
85
|
+
if (code !== 0) return yield* failure("access", {
|
|
86
|
+
exitCode: code,
|
|
87
|
+
package: name
|
|
88
|
+
});
|
|
89
|
+
yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Literal(version)))(output);
|
|
90
|
+
})).pipe(Effect.timeout("30 seconds"), Effect.mapError((cause) => failure("access", cause)));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
const preflight = Effect.fn("Scaffold.preflight")((versions, exactReplay) => Effect.acquireUseRelease(attempt("access", () => mkdtemp(join(tmpdir(), "dual-registry-probe-"))), (cwd) => Effect.gen(function* () {
|
|
94
|
+
yield* attempt("access", () => writeFile(join(cwd, "package.json"), "{\"private\":true}\n", {
|
|
95
|
+
flag: "wx",
|
|
96
|
+
mode: 384
|
|
97
|
+
}));
|
|
98
|
+
if (exactReplay) for (const [name, version] of Record.toEntries(versions)) yield* archives.pack(`${name}@${version}`, cwd).pipe(Effect.mapError((cause) => failure("access", cause)));
|
|
99
|
+
else {
|
|
100
|
+
yield* probeVersions(cwd, versions);
|
|
101
|
+
const adapter = versions["@dual/workspace-opensandbox"];
|
|
102
|
+
if (adapter !== void 0) yield* archives.pack(`@dual/workspace-opensandbox@${adapter}`, cwd).pipe(Effect.mapError((cause) => failure("access", cause)));
|
|
103
|
+
}
|
|
104
|
+
}), (cwd) => attempt("access", () => rm(cwd, {
|
|
105
|
+
force: true,
|
|
106
|
+
recursive: true
|
|
107
|
+
}))));
|
|
108
|
+
const create = Effect.fn("Scaffold.create")(function* (request) {
|
|
109
|
+
const input = yield* Schema.decodeUnknownEffect(Request)(request).pipe(Effect.mapError((cause) => failure("options", cause)));
|
|
110
|
+
if (input.skipInstall && !input.bare && input.replay === void 0 && input.release === void 0 && input.manifest === void 0) return yield* failure("options", "Offline generation requires --bare --skip-install");
|
|
111
|
+
if (input.release !== void 0 && input.manifest !== void 0 || (input.release !== void 0 || input.manifest !== void 0) && (input.releasePair !== void 0 || input.webImage !== void 0 || input.replay !== void 0) || input.replay !== void 0 && (input.releasePair !== void 0 || input.webImage !== void 0)) return yield* failure("options", "Release selectors cannot be combined with explicit pairs or replay");
|
|
112
|
+
const destination = resolve(input.destination);
|
|
113
|
+
yield* emptyDestination(destination);
|
|
114
|
+
const replayPath = input.replay;
|
|
115
|
+
const recorded = replayPath === void 0 ? record({ cli: input.cliVersion }, input.bare, input.host) : yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Replay), { onExcessProperty: "error" })(yield* attempt("replay", () => readFile(replayPath, "utf8"))).pipe(Effect.mapError((cause) => failure("replay", cause)));
|
|
116
|
+
if (replayPath !== void 0 && recorded.cliVersion !== input.cliVersion) return yield* failure("replay", "Invoke the exact recorded CLI version");
|
|
117
|
+
const verified = replayPath !== void 0 && recorded.release !== null ? yield* releases.verify(recorded.release).pipe(Effect.mapError((cause) => failure("replay", cause))) : recorded.release;
|
|
118
|
+
if (input.releasePair === void 0 !== (input.webImage === void 0)) return yield* failure("pair", "Both pair and immutable web image are required");
|
|
119
|
+
const pairPath = input.releasePair;
|
|
120
|
+
const pairSelection = pairPath !== void 0 && input.webImage !== void 0 ? yield* Schema.decodeUnknownEffect(Selection)({
|
|
121
|
+
pair: yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Pair))(yield* attempt("pair", () => readFile(pairPath, "utf8"))).pipe(Effect.mapError((cause) => failure("pair", cause))),
|
|
122
|
+
webImage: input.webImage
|
|
123
|
+
}).pipe(Effect.mapError((cause) => failure("pair", cause))) : recorded.deployment;
|
|
124
|
+
const resolveRelease = input.replay === void 0 && input.releasePair === void 0 && (input.release !== void 0 || input.manifest !== void 0 || !(input.bare && input.skipInstall));
|
|
125
|
+
const release = resolveRelease ? yield* releases.resolveForCreate(input.manifest === void 0 ? { core: input.release ?? "latest" } : { manifest: input.manifest }, {
|
|
126
|
+
cli: input.cliVersion,
|
|
127
|
+
template: revision
|
|
128
|
+
}).pipe(Effect.mapError((cause) => failure("pair", cause))) : verified;
|
|
129
|
+
const deployment = resolveRelease && release !== null ? {
|
|
130
|
+
pair: release.manifest.pair,
|
|
131
|
+
webImage: release.manifest.pair.webImage
|
|
132
|
+
} : pairSelection;
|
|
133
|
+
if (input.replay !== void 0 && deployment !== null) {
|
|
134
|
+
const image = deployment.webImage;
|
|
135
|
+
const args = String.startsWith("sha256:")(image) ? [
|
|
136
|
+
"image",
|
|
137
|
+
"inspect",
|
|
138
|
+
image
|
|
139
|
+
] : [
|
|
140
|
+
"manifest",
|
|
141
|
+
"inspect",
|
|
142
|
+
image
|
|
143
|
+
];
|
|
144
|
+
if ((yield* spawner.exitCode(ChildProcess.make("docker", args, {
|
|
145
|
+
stderr: "ignore",
|
|
146
|
+
stdin: "ignore",
|
|
147
|
+
stdout: "ignore"
|
|
148
|
+
})).pipe(Effect.timeout("30 seconds"), Effect.mapError((cause) => failure("pair", cause)))) !== 0) return yield* failure("pair", "Exact web artifact unavailable");
|
|
149
|
+
}
|
|
150
|
+
const replay = yield* Schema.decodeUnknownEffect(Replay, { onExcessProperty: "error" })(input.replay === void 0 ? record({ cli: input.cliVersion }, input.bare, input.host, deployment, release) : recorded).pipe(Effect.mapError((cause) => failure(input.replay === void 0 ? "options" : "replay", cause)));
|
|
151
|
+
if (!input.skipInstall || input.replay !== void 0) {
|
|
152
|
+
const versions = { ...replay.packages };
|
|
153
|
+
if (replay.choices.workspace !== "opensandbox") delete versions["@dual/workspace-opensandbox"];
|
|
154
|
+
if (input.replay !== void 0) versions["@dual-os/cli"] = replay.cliVersion;
|
|
155
|
+
yield* preflight(versions, input.replay !== void 0);
|
|
156
|
+
}
|
|
157
|
+
yield* emptyDestination(destination);
|
|
158
|
+
const content = {
|
|
159
|
+
...yield* attempt("write", () => files$1(replay)),
|
|
160
|
+
...files
|
|
161
|
+
};
|
|
162
|
+
yield* attempt("write", () => mkdir(dirname(destination), { recursive: true }));
|
|
163
|
+
yield* Effect.acquireUseRelease(attempt("write", () => mkdtemp(join(dirname(destination), ".dual-create-"))), (staging) => Effect.gen(function* () {
|
|
164
|
+
for (const [path, body] of Record.toEntries(content)) yield* attempt("write", async () => {
|
|
165
|
+
const target = join(staging, path);
|
|
166
|
+
await mkdir(dirname(target), { recursive: true });
|
|
167
|
+
await writeFile(target, body, {
|
|
168
|
+
flag: "wx",
|
|
169
|
+
mode: 420
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
yield* sourceReference.register(staging).pipe(Effect.mapError((cause) => failure("write", cause)));
|
|
173
|
+
yield* emptyDestination(destination);
|
|
174
|
+
yield* attempt("write", () => rename(staging, destination));
|
|
175
|
+
}), (staging) => attempt("write", () => rm(staging, {
|
|
176
|
+
force: true,
|
|
177
|
+
recursive: true
|
|
178
|
+
})));
|
|
179
|
+
if (!input.skipInstall) {
|
|
180
|
+
const code = yield* spawner.exitCode(ChildProcess.make("bun", ["install"], {
|
|
181
|
+
cwd: destination,
|
|
182
|
+
stderr: "ignore",
|
|
183
|
+
stdin: "ignore",
|
|
184
|
+
stdout: "ignore"
|
|
185
|
+
})).pipe(Effect.mapError((cause) => failure("install", cause)));
|
|
186
|
+
if (code !== 0) return yield* failure("install", { exitCode: code });
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
deployment: replay.deployment,
|
|
190
|
+
destination,
|
|
191
|
+
installed: !input.skipInstall
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
return Service.of({ create });
|
|
195
|
+
})).pipe(Layer.provide(layer$1));
|
|
196
|
+
export { Request, scaffold_exports as Scaffold, ScaffoldError, Service, layer };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","names":["Choices.Host","Releases.Version","Releases.Selector","Deployment.Image","Archives.Service","SourceReference.Service","Releases.Service","Template.record","Template.Replay","Deployment.Selection","Deployment.Pair","Template.revision","Template.files","SourceReference.files","SourceReference.layer"],"sources":["../../src/create/scaffold.ts"],"sourcesContent":["import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join, resolve } from \"node:path\";\n\nimport { Array, Context, Effect, Layer, Record, Redacted, Schema, Stream, String } from \"effect\";\n\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { Archives } from \"../release/archives.ts\";\nimport { Releases } from \"../release/releases.ts\";\n\nimport { Choices } from \"./choices.ts\";\nimport { Deployment } from \"./deployment.ts\";\nimport { SourceReference } from \"./source-reference.ts\";\nimport { Template } from \"./template.ts\";\n\nexport const Request = Schema.Struct({\n bare: Schema.Boolean,\n cliVersion: Schema.NonEmptyString,\n destination: Schema.NonEmptyString.check(\n Schema.isPattern(/^[^\\p{Cc}]+$/u),\n Schema.isPattern(/\\S/, { message: \"Destination must not be blank\" }),\n ),\n host: Choices.Host,\n manifest: Schema.optional(Releases.Version),\n release: Schema.optional(Releases.Selector),\n releasePair: Schema.optional(Schema.NonEmptyString),\n replay: Schema.optional(Schema.NonEmptyString),\n skipInstall: Schema.Boolean,\n webImage: Schema.optional(Deployment.Image),\n});\nexport type Request = typeof Request.Type;\n\nexport class ScaffoldError extends Schema.TaggedError<ScaffoldError>()(\"ScaffoldError\", {\n cause: Schema.Redacted(Schema.Defect()),\n operation: Schema.Literals([\n \"options\",\n \"replay\",\n \"destination\",\n \"access\",\n \"write\",\n \"install\",\n \"pair\",\n ]),\n}) {}\nconst failure = (operation: ScaffoldError[\"operation\"], cause: unknown) =>\n new ScaffoldError({ cause: Redacted.make(cause), operation });\n// Node filesystem promises cannot be cancelled. Finish each operation before\n// interruption releases its staging/probe directory; no mutation may outlive it.\nconst attempt = <A>(operation: ScaffoldError[\"operation\"], run: () => Promise<A>) =>\n Effect.tryPromise({ catch: cause => failure(operation, cause), try: run }).pipe(\n Effect.uninterruptible,\n );\n\nconst FileError = Schema.Struct({ code: Schema.String });\nconst isMissing = Schema.is(FileError.check(Schema.makeFilter(error => error.code === \"ENOENT\")));\n\nconst emptyDestination = Effect.fn(\"Scaffold.emptyDestination\")(function* (destination: string) {\n const stat = yield* Effect.tryPromise(() => lstat(destination)).pipe(\n Effect.catchIf(\n cause => isMissing(cause.cause),\n () => Effect.void,\n ),\n Effect.mapError(cause => failure(\"destination\", cause.cause)),\n Effect.uninterruptible,\n );\n if (stat === undefined) return;\n if (\n !stat.isDirectory() ||\n Array.isArrayNonEmpty(yield* attempt(\"destination\", () => readdir(destination)))\n ) {\n return yield* failure(\n \"destination\",\n new Error(\"Destination must be absent or an empty directory, not a symlink\"),\n );\n }\n});\n\nexport type Interface = {\n readonly create: (\n request: Request,\n ) => Effect.Effect<\n {\n readonly installed: boolean;\n readonly destination: string;\n readonly deployment: Deployment.ResolvedSelection | null;\n },\n ScaffoldError\n >;\n};\nexport class Service extends Context.Service<Service, Interface>()(\"@dual-os/cli/Scaffold\") {}\n\nexport const layer = Layer.effect(\n Service,\n Effect.gen(function* () {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const archives = yield* Archives.Service;\n const sourceReference = yield* SourceReference.Service;\n const releases = yield* Releases.Service;\n\n const probeVersions = Effect.fn(\"Scaffold.probeVersions\")(function* (\n cwd: string,\n versions: Readonly<Record<string, string>>,\n ) {\n for (const [name, version] of Record.toEntries(versions)) {\n if (!String.startsWith(\"@dual/\")(name) && name !== \"@dual-os/sdk\") continue;\n yield* Effect.scoped(\n Effect.gen(function* () {\n const handle = yield* spawner.spawn(\n ChildProcess.make(\n \"bun\",\n [\"info\", `${name}@${version}`, \"version\", \"--json\", \"--no-cache\"],\n { cwd, stderr: \"ignore\", stdin: \"ignore\", stdout: \"pipe\" },\n ),\n );\n const output = yield* Stream.mkString(Stream.decodeText(handle.stdout));\n const code = yield* handle.exitCode;\n if (code !== 0) return yield* failure(\"access\", { exitCode: code, package: name });\n yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Literal(version)))(\n output,\n );\n }),\n ).pipe(\n Effect.timeout(\"30 seconds\"),\n Effect.mapError(cause => failure(\"access\", cause)),\n );\n }\n });\n\n const preflight = Effect.fn(\"Scaffold.preflight\")(\n (versions: Readonly<Record<string, string>>, exactReplay: boolean) =>\n Effect.acquireUseRelease(\n attempt(\"access\", () => mkdtemp(join(tmpdir(), \"dual-registry-probe-\"))),\n cwd =>\n Effect.gen(function* () {\n // Bun 1.4.2 info requires a package project even for metadata reads.\n // Keep the probe independent of the destination and launch directory.\n // Inherit environment and user-level Bun/npm config; never copy auth.\n yield* attempt(\"access\", () =>\n writeFile(join(cwd, \"package.json\"), '{\"private\":true}\\n', {\n flag: \"wx\",\n mode: 0o600,\n }),\n );\n if (exactReplay) {\n // Metadata availability is not artifact availability. Fetch every\n // exact direct artifact, including public baseline pins and CLI,\n // without installing/resolving dependencies or running scripts.\n for (const [name, version] of Record.toEntries(versions)) {\n yield* archives\n .pack(`${name}@${version}`, cwd)\n .pipe(Effect.mapError(cause => failure(\"access\", cause)));\n }\n } else {\n yield* probeVersions(cwd, versions);\n // This new optional artifact may not have been published with the\n // fixed baseline. Metadata alone must not authorize a scaffold.\n const adapter = versions[\"@dual/workspace-opensandbox\"];\n if (adapter !== undefined) {\n yield* archives\n .pack(`@dual/workspace-opensandbox@${adapter}`, cwd)\n .pipe(Effect.mapError(cause => failure(\"access\", cause)));\n }\n }\n }),\n cwd => attempt(\"access\", () => rm(cwd, { force: true, recursive: true })),\n ),\n );\n\n const create = Effect.fn(\"Scaffold.create\")(function* (request: Request) {\n const input = yield* Schema.decodeUnknownEffect(Request)(request).pipe(\n Effect.mapError(cause => failure(\"options\", cause)),\n );\n if (\n input.skipInstall &&\n !input.bare &&\n input.replay === undefined &&\n input.release === undefined &&\n input.manifest === undefined\n ) {\n return yield* failure(\"options\", \"Offline generation requires --bare --skip-install\");\n }\n if (\n (input.release !== undefined && input.manifest !== undefined) ||\n ((input.release !== undefined || input.manifest !== undefined) &&\n (input.releasePair !== undefined ||\n input.webImage !== undefined ||\n input.replay !== undefined)) ||\n (input.replay !== undefined &&\n (input.releasePair !== undefined || input.webImage !== undefined))\n ) {\n return yield* failure(\n \"options\",\n \"Release selectors cannot be combined with explicit pairs or replay\",\n );\n }\n const destination = resolve(input.destination);\n yield* emptyDestination(destination);\n const replayPath = input.replay;\n const recorded =\n replayPath === undefined\n ? Template.record({ cli: input.cliVersion }, input.bare, input.host)\n : yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Template.Replay), {\n onExcessProperty: \"error\",\n })(yield* attempt(\"replay\", () => readFile(replayPath, \"utf8\"))).pipe(\n Effect.mapError(cause => failure(\"replay\", cause)),\n );\n if (replayPath !== undefined && recorded.cliVersion !== input.cliVersion) {\n return yield* failure(\"replay\", \"Invoke the exact recorded CLI version\");\n }\n const verified =\n replayPath !== undefined && recorded.release !== null\n ? yield* releases\n .verify(recorded.release)\n .pipe(Effect.mapError(cause => failure(\"replay\", cause)))\n : recorded.release;\n if ((input.releasePair === undefined) !== (input.webImage === undefined)) {\n return yield* failure(\"pair\", \"Both pair and immutable web image are required\");\n }\n const pairPath = input.releasePair;\n const pairSelection =\n pairPath !== undefined && input.webImage !== undefined\n ? yield* Schema.decodeUnknownEffect(Deployment.Selection)({\n pair: yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Deployment.Pair))(\n yield* attempt(\"pair\", () => readFile(pairPath, \"utf8\")),\n ).pipe(Effect.mapError(cause => failure(\"pair\", cause))),\n webImage: input.webImage,\n }).pipe(Effect.mapError(cause => failure(\"pair\", cause)))\n : recorded.deployment;\n const resolveRelease =\n input.replay === undefined &&\n input.releasePair === undefined &&\n (input.release !== undefined ||\n input.manifest !== undefined ||\n !(input.bare && input.skipInstall));\n const release = resolveRelease\n ? yield* releases\n .resolveForCreate(\n input.manifest === undefined\n ? { core: input.release ?? \"latest\" }\n : { manifest: input.manifest },\n { cli: input.cliVersion, template: Template.revision },\n )\n .pipe(Effect.mapError(cause => failure(\"pair\", cause)))\n : verified;\n const deployment =\n resolveRelease && release !== null\n ? { pair: release.manifest.pair, webImage: release.manifest.pair.webImage }\n : pairSelection;\n if (input.replay !== undefined && deployment !== null) {\n const image = deployment.webImage;\n const args = String.startsWith(\"sha256:\")(image)\n ? [\"image\", \"inspect\", image]\n : [\"manifest\", \"inspect\", image];\n const code = yield* spawner\n .exitCode(\n ChildProcess.make(\"docker\", args, {\n stderr: \"ignore\",\n stdin: \"ignore\",\n stdout: \"ignore\",\n }),\n )\n .pipe(\n Effect.timeout(\"30 seconds\"),\n Effect.mapError(cause => failure(\"pair\", cause)),\n );\n if (code !== 0) return yield* failure(\"pair\", \"Exact web artifact unavailable\");\n }\n const replay = yield* Schema.decodeUnknownEffect(Template.Replay, {\n onExcessProperty: \"error\",\n })(\n input.replay === undefined\n ? Template.record({ cli: input.cliVersion }, input.bare, input.host, deployment, release)\n : recorded,\n ).pipe(\n Effect.mapError(cause => failure(input.replay === undefined ? \"options\" : \"replay\", cause)),\n );\n if (!input.skipInstall || input.replay !== undefined) {\n const versions = { ...replay.packages };\n // The manifest records the complete release, but this host only needs\n // the optional adapter when it actually selects OpenSandbox.\n if (replay.choices.workspace !== \"opensandbox\") {\n delete versions[\"@dual/workspace-opensandbox\"];\n }\n if (input.replay !== undefined) versions[\"@dual-os/cli\"] = replay.cliVersion;\n yield* preflight(versions, input.replay !== undefined);\n }\n // Recheck after registry I/O. Generate completely in a private sibling before\n // renaming: no partially written scaffold and no overwrite of customer files.\n yield* emptyDestination(destination);\n const rendered = yield* attempt(\"write\", () => Template.files(replay));\n const content = { ...rendered, ...SourceReference.files };\n yield* attempt(\"write\", () => mkdir(dirname(destination), { recursive: true }));\n yield* Effect.acquireUseRelease(\n attempt(\"write\", () => mkdtemp(join(dirname(destination), \".dual-create-\"))),\n staging =>\n Effect.gen(function* () {\n for (const [path, body] of Record.toEntries(content)) {\n yield* attempt(\"write\", async () => {\n const target = join(staging, path);\n await mkdir(dirname(target), { recursive: true });\n await writeFile(target, body, { flag: \"wx\", mode: 0o644 });\n });\n }\n yield* sourceReference\n .register(staging)\n .pipe(Effect.mapError(cause => failure(\"write\", cause)));\n yield* emptyDestination(destination);\n yield* attempt(\"write\", () => rename(staging, destination));\n }),\n staging => attempt(\"write\", () => rm(staging, { force: true, recursive: true })),\n );\n if (!input.skipInstall) {\n // No shell and no echoed child output: package managers may print tokens,\n // registry URLs, lifecycle output or environment-derived credentials.\n const code = yield* spawner\n .exitCode(\n ChildProcess.make(\"bun\", [\"install\"], {\n cwd: destination,\n stderr: \"ignore\",\n stdin: \"ignore\",\n stdout: \"ignore\",\n }),\n )\n .pipe(Effect.mapError(cause => failure(\"install\", cause)));\n if (code !== 0) return yield* failure(\"install\", { exitCode: code });\n }\n return { deployment: replay.deployment, destination, installed: !input.skipInstall };\n });\n return Service.of({ create });\n }),\n).pipe(Layer.provide(SourceReference.layer));\n\nexport * as Scaffold from \"./scaffold.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,UAAU,OAAO,OAAO;CACnC,MAAM,OAAO;CACb,YAAY,OAAO;CACnB,aAAa,OAAO,eAAe,MACjC,OAAO,UAAU,eAAe,GAChC,OAAO,UAAU,MAAM,EAAE,SAAS,gCAAgC,CAAC,CACrE;CACA,MAAMA;CACN,UAAU,OAAO,SAASC,OAAgB;CAC1C,SAAS,OAAO,SAASC,QAAiB;CAC1C,aAAa,OAAO,SAAS,OAAO,cAAc;CAClD,QAAQ,OAAO,SAAS,OAAO,cAAc;CAC7C,aAAa,OAAO;CACpB,UAAU,OAAO,SAASC,KAAgB;AAC5C,CAAC;AAGD,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,OAAO,OAAO,SAAS,OAAO,OAAO,CAAC;CACtC,WAAW,OAAO,SAAS;EACzB;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH,CAAC,CAAC,CAAC,CAAC;AACJ,MAAM,WAAW,WAAuC,UACtD,IAAI,cAAc;CAAE,OAAO,SAAS,KAAK,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AW,GAAG,eAAe,CAAC,CAAC,IAC3E,YACE,OAAO,IAAI,aAAa;GACtB,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,UAAU,OAAO,GACjD,OAAO,QAAQ,SAAS,YAAY;IAClC,MAAM,SAAS,KAAK,SAAS,IAAI;IACjC,MAAM,MAAM,QAAQ,MAAM,GAAG,EAAE,WAAW,KAAK,CAAC;IAChD,MAAM,UAAU,QAAQ,MAAM;KAAE,MAAM;KAAM,MAAM;IAAM,CAAC;GAC3D,CAAC;GAEH,OAAO,gBACJ,SAAS,OAAO,CAAC,CACjB,KAAK,OAAO,UAAS,UAAS,QAAQ,SAAS,KAAK,CAAC,CAAC;GACzD,OAAO,iBAAiB,WAAW;GACnC,OAAO,QAAQ,eAAe,OAAO,SAAS,WAAW,CAAC;EAC5D,CAAC,IACH,YAAW,QAAQ,eAAe,GAAG,SAAS;GAAE,OAAO;GAAM,WAAW;EAAK,CAAC,CAAC,CACjF;EACA,IAAI,CAAC,MAAM,aAAa;GAGtB,MAAM,OAAO,OAAO,QACjB,SACC,aAAa,KAAK,OAAO,CAAC,SAAS,GAAG;IACpC,KAAK;IACL,QAAQ;IACR,OAAO;IACP,QAAQ;GACV,CAAC,CACH,CAAC,CACA,KAAK,OAAO,UAAS,UAAS,QAAQ,WAAW,KAAK,CAAC,CAAC;GAC3D,IAAI,SAAS,GAAG,OAAO,OAAO,QAAQ,WAAW,EAAE,UAAU,KAAK,CAAC;EACrE;EACA,OAAO;GAAE,YAAY,OAAO;GAAY;GAAa,WAAW,CAAC,MAAM;EAAY;CACrF,CAAC;CACD,OAAO,QAAQ,GAAG,EAAE,OAAO,CAAC;AAC9B,CAAC,CACH,CAAC,CAAC,KAAK,MAAM,QAAQC,OAAqB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "./source-reference.js";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
import { ChildProcessSpawner } from "effect/process";
|
|
4
|
+
declare namespace source_reference_d_exports {
|
|
5
|
+
export { FdeDocsRecord, Interface, Record, Service, source_reference_d_exports as SourceReference, SourceReferenceError, fdeDocsRecord, files, initCommand, layer, record };
|
|
6
|
+
}
|
|
7
|
+
export declare const Record: Schema.Struct<{
|
|
8
|
+
readonly commit: Schema.Literal<"1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d">;
|
|
9
|
+
readonly path: Schema.Literal<"vendor/dual">;
|
|
10
|
+
readonly url: Schema.Literal<"git@git.datapizza.tech:dual/dual.git">;
|
|
11
|
+
}>;
|
|
12
|
+
export type Record = typeof Record.Type;
|
|
13
|
+
export declare const record: Record;
|
|
14
|
+
export declare const FdeDocsRecord: Schema.Struct<{
|
|
15
|
+
readonly commit: Schema.Literal<"b7a1c2343758d77a55994ea1b7d5ac46f6547011">;
|
|
16
|
+
readonly path: Schema.Literal<"vendor/fdes-docs">;
|
|
17
|
+
readonly url: Schema.Literal<"git@git.datapizza.tech:dual/fdes-docs.git">;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const fdeDocsRecord: typeof FdeDocsRecord.Type;
|
|
20
|
+
export declare const initCommand: string;
|
|
21
|
+
export declare const files: {
|
|
22
|
+
".gitmodules": string;
|
|
23
|
+
"AGENTS.md": string;
|
|
24
|
+
"DUAL-SOURCE.md": string;
|
|
25
|
+
"FDE-DOCS.md": string;
|
|
26
|
+
};
|
|
27
|
+
declare const SourceReferenceError_base: Schema.Class<SourceReferenceError, Schema.TaggedStruct<"SourceReferenceError", {
|
|
28
|
+
readonly cause: Schema.Redacted<Schema.Defect>;
|
|
29
|
+
}>, import("effect/Cause").YieldableError>;
|
|
30
|
+
export declare class SourceReferenceError extends SourceReferenceError_base {}
|
|
31
|
+
export type Interface = {
|
|
32
|
+
/** Register in a fresh, privately owned scaffold staging directory only. */
|
|
33
|
+
readonly register: (staging: string) => Effect.Effect<void, SourceReferenceError>;
|
|
34
|
+
};
|
|
35
|
+
declare const Service_base: Context.ServiceClass<Service, "@dual-os/cli/SourceReference", Interface>;
|
|
36
|
+
export declare class Service extends Service_base {}
|
|
37
|
+
export declare const layer: Layer.Layer<Service, never, ChildProcessSpawner.ChildProcessSpawner>;
|
|
38
|
+
export { source_reference_d_exports as SourceReference };
|
|
39
|
+
//# sourceMappingURL=source-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-reference.d.ts","names":[],"sources":["../../src/create/source-reference.ts"],"mappings":";;;;;;qBAOa,QAAM,OAAA;;;;;YAKP,gBAAgB,OAAO;qBACtB,QAAQ;qBAMR,eAAa,OAAA;;;;;qBAKb,sBAAsB,cAAc;qBAMpC;qBAKA;EACX;EAQA;EACA;EA0BA;;;;;qBAiCW,6BAA6B;YAO9B;;WAED,WAAW,oBAAoB,OAAO,aAAa;;;qBAEjD,gBAAgB;qBAIhB,OAAK,MAAA,MAAA,gBAAA,oBAAA"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import "./source-reference.js";
|
|
3
|
+
import { Array, Context, Effect, Layer, Redacted, Schema, Stream, String } from "effect";
|
|
4
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
|
+
import { mkdir } from "node:fs/promises";
|
|
6
|
+
import { join, resolve } from "node:path";
|
|
7
|
+
// src/create/source-reference.ts
|
|
8
|
+
var source_reference_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
FdeDocsRecord: () => FdeDocsRecord,
|
|
10
|
+
Record: () => Record,
|
|
11
|
+
Service: () => Service,
|
|
12
|
+
SourceReference: () => source_reference_exports,
|
|
13
|
+
SourceReferenceError: () => SourceReferenceError,
|
|
14
|
+
fdeDocsRecord: () => fdeDocsRecord,
|
|
15
|
+
files: () => files,
|
|
16
|
+
initCommand: () => initCommand,
|
|
17
|
+
layer: () => layer,
|
|
18
|
+
record: () => record
|
|
19
|
+
});
|
|
20
|
+
const Record = Schema.Struct({
|
|
21
|
+
commit: Schema.Literal("1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d"),
|
|
22
|
+
path: Schema.Literal("vendor/dual"),
|
|
23
|
+
url: Schema.Literal("git@git.datapizza.tech:dual/dual.git")
|
|
24
|
+
});
|
|
25
|
+
const record = {
|
|
26
|
+
commit: "1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d",
|
|
27
|
+
path: "vendor/dual",
|
|
28
|
+
url: "git@git.datapizza.tech:dual/dual.git"
|
|
29
|
+
};
|
|
30
|
+
const FdeDocsRecord = Schema.Struct({
|
|
31
|
+
commit: Schema.Literal("b7a1c2343758d77a55994ea1b7d5ac46f6547011"),
|
|
32
|
+
path: Schema.Literal("vendor/fdes-docs"),
|
|
33
|
+
url: Schema.Literal("git@git.datapizza.tech:dual/fdes-docs.git")
|
|
34
|
+
});
|
|
35
|
+
const fdeDocsRecord = {
|
|
36
|
+
commit: "b7a1c2343758d77a55994ea1b7d5ac46f6547011",
|
|
37
|
+
path: "vendor/fdes-docs",
|
|
38
|
+
url: "git@git.datapizza.tech:dual/fdes-docs.git"
|
|
39
|
+
};
|
|
40
|
+
const references = [record, fdeDocsRecord];
|
|
41
|
+
const initCommand = `git submodule update --init -- ${Array.join(Array.map(references, (reference) => reference.path), " ")}`;
|
|
42
|
+
const files = {
|
|
43
|
+
".gitmodules": Array.join(Array.map(references, (reference) => `[submodule "${String.slice(7)(reference.path)}"]\n\tpath = ${reference.path}\n\turl = ${reference.url}\n\tupdate = checkout\n`), ""),
|
|
44
|
+
"AGENTS.md": `# Customer-owned Dual host\n\nBefore changing Dual host composition, plugins, or workflows, read\n[DUAL-SOURCE.md](DUAL-SOURCE.md), then consult the relevant source and docs in\n\`vendor/dual\`. If the checkout is absent, follow the explicit initialization\ninstructions there. Treat that checkout as read-only reference; use the installed\npublic \`@dual/*\` and \`@dual-os/*\` exports for application imports and verify APIs against the\ninstalled package versions. Keep changes in this customer's workspace.\n\nBefore scoping customer requirements, designing use cases, or planning delivery,\nread [FDE-DOCS.md](FDE-DOCS.md) for the read-only FDE guidance and access boundary.\n`,
|
|
45
|
+
"DUAL-SOURCE.md": `# Dual source reference\n
|
|
46
|
+
This repository registers a real Git submodule at \`${record.path}\`, pinned to
|
|
47
|
+
\`${record.commit}\` from \`${record.url}\`.
|
|
48
|
+
|
|
49
|
+
It is reference-only: never import it or use it as a runtime dependency or a
|
|
50
|
+
workspace dependency. Runtime packages come from the package registry; this
|
|
51
|
+
pinned source snapshot may differ from those packages.
|
|
52
|
+
|
|
53
|
+
Creation requires Git but does not fetch source or contact the network for this
|
|
54
|
+
reference, including during offline creation. Only .gitmodules and the pinned
|
|
55
|
+
gitlinks are staged; no commit is created and application files and secrets are
|
|
56
|
+
not staged. Commit them separately after reviewing what you want to publish.
|
|
57
|
+
|
|
58
|
+
To obtain the private source, explicitly run:
|
|
59
|
+
|
|
60
|
+
\`\`\`sh
|
|
61
|
+
git submodule update --init -- vendor/dual
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
For the separate FDE guidance, read [FDE-DOCS.md](FDE-DOCS.md).
|
|
65
|
+
\`bun run source:init\` initializes both pinned references explicitly.
|
|
66
|
+
|
|
67
|
+
Supply Git/SSH credentials externally. No credentials are generated or stored by
|
|
68
|
+
the scaffold. There are no recursive automatic submodule updates: do not use
|
|
69
|
+
--recursive unless you deliberately want the source repository's own references.
|
|
70
|
+
`,
|
|
71
|
+
"FDE-DOCS.md": `# FDE documentation reference\n
|
|
72
|
+
This repository registers a read-only Git submodule at \`${fdeDocsRecord.path}\`,
|
|
73
|
+
pinned to \`${fdeDocsRecord.commit}\` from \`${fdeDocsRecord.url}\` (master).
|
|
74
|
+
The branch identifies the pin's origin; initialization checks out the committed
|
|
75
|
+
snapshot, not the latest branch tip.
|
|
76
|
+
|
|
77
|
+
For customer requirements, use-case design and delivery planning, start with
|
|
78
|
+
\`vendor/fdes-docs/README.md\` and \`vendor/fdes-docs/FOLDER_STRUCTURE.md\`, then
|
|
79
|
+
consult relevant guidance in \`vendor/fdes-docs/AGENTS.md\` and \`vendor/fdes-docs/dualos/\`.
|
|
80
|
+
Keep customer implementation and deliverables in this workspace. The upstream
|
|
81
|
+
instructions describe a separate writable engagement repository: do not adopt
|
|
82
|
+
its hook setup, workspace paths or write operations for this reference checkout.
|
|
83
|
+
|
|
84
|
+
The private repository includes other customers' material. Access to Dual does
|
|
85
|
+
not grant access to FDE docs or authorize reuse or disclosure of that material.
|
|
86
|
+
Consult only material authorized for the current engagement. Read-only is a
|
|
87
|
+
workspace policy, not a Git permission restriction.
|
|
88
|
+
|
|
89
|
+
Creation registers the gitlink without fetching or committing. To download only
|
|
90
|
+
this reference, configure external Git/SSH access to the FDE docs project and run:
|
|
91
|
+
|
|
92
|
+
\`\`\`sh
|
|
93
|
+
git submodule update --init -- vendor/fdes-docs
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
\`bun run source:init\` explicitly downloads both references without recursion.
|
|
97
|
+
If access fails, request project access and check SSH/network configuration;
|
|
98
|
+
scaffolding and runtime packages do not depend on this checkout. Never import it
|
|
99
|
+
or add it as a runtime or workspace dependency. No credentials are stored by the
|
|
100
|
+
scaffold. See [DUAL-SOURCE.md](DUAL-SOURCE.md) for the product source reference.
|
|
101
|
+
`
|
|
102
|
+
};
|
|
103
|
+
var SourceReferenceError = class extends Schema.TaggedError()("SourceReferenceError", { cause: Schema.Redacted(Schema.Defect()) }) {};
|
|
104
|
+
const failure = (cause) => new SourceReferenceError({ cause: Redacted.make(cause) });
|
|
105
|
+
const ObjectId = Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/));
|
|
106
|
+
var Service = class extends Context.Service()("@dual-os/cli/SourceReference") {};
|
|
107
|
+
const layer = Layer.effect(Service, Effect.gen(function* () {
|
|
108
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
109
|
+
const register = Effect.fn("SourceReference.register")(function* (staging) {
|
|
110
|
+
const cwd = resolve(staging);
|
|
111
|
+
yield* Effect.tryPromise({
|
|
112
|
+
catch: failure,
|
|
113
|
+
try: async () => {
|
|
114
|
+
await mkdir(join(cwd, ".git"));
|
|
115
|
+
for (const reference of references) await mkdir(join(cwd, reference.path), { recursive: true });
|
|
116
|
+
}
|
|
117
|
+
}).pipe(Effect.uninterruptible);
|
|
118
|
+
const nullDevice = process.platform === "win32" ? "NUL" : "/dev/null";
|
|
119
|
+
const env = {
|
|
120
|
+
GIT_CONFIG_GLOBAL: nullDevice,
|
|
121
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
122
|
+
GIT_CONFIG_SYSTEM: nullDevice,
|
|
123
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
124
|
+
PATH: process.env["PATH"],
|
|
125
|
+
SystemRoot: process.platform === "win32" ? process.env["SystemRoot"] : void 0
|
|
126
|
+
};
|
|
127
|
+
const run = Effect.fn("SourceReference.git")(function* (args, capture = false) {
|
|
128
|
+
const handle = yield* spawner.spawn(ChildProcess.make("git", [
|
|
129
|
+
`--git-dir=${join(cwd, ".git")}`,
|
|
130
|
+
`--work-tree=${cwd}`,
|
|
131
|
+
"-c",
|
|
132
|
+
`core.hooksPath=${nullDevice}`,
|
|
133
|
+
"-c",
|
|
134
|
+
"core.fsmonitor=false",
|
|
135
|
+
"-c",
|
|
136
|
+
"submodule.recurse=false",
|
|
137
|
+
"-c",
|
|
138
|
+
"protocol.allow=never",
|
|
139
|
+
...args
|
|
140
|
+
], {
|
|
141
|
+
cwd,
|
|
142
|
+
env,
|
|
143
|
+
extendEnv: false,
|
|
144
|
+
stderr: "ignore",
|
|
145
|
+
stdin: "ignore",
|
|
146
|
+
stdout: capture ? "pipe" : "ignore"
|
|
147
|
+
}));
|
|
148
|
+
const output = capture ? yield* Stream.mkString(Stream.decodeText(handle.stdout)) : "";
|
|
149
|
+
const code = yield* handle.exitCode;
|
|
150
|
+
if (code !== 0) return yield* failure({ exitCode: code });
|
|
151
|
+
return output;
|
|
152
|
+
}, Effect.scoped, Effect.mapError((cause) => failure(cause)));
|
|
153
|
+
yield* run([
|
|
154
|
+
"-c",
|
|
155
|
+
"init.defaultBranch=main",
|
|
156
|
+
"init",
|
|
157
|
+
"--template=",
|
|
158
|
+
"--object-format=sha1",
|
|
159
|
+
cwd
|
|
160
|
+
]);
|
|
161
|
+
const output = yield* run([
|
|
162
|
+
"hash-object",
|
|
163
|
+
"-w",
|
|
164
|
+
"--no-filters",
|
|
165
|
+
"--",
|
|
166
|
+
".gitmodules"
|
|
167
|
+
], true);
|
|
168
|
+
yield* run([
|
|
169
|
+
"update-index",
|
|
170
|
+
"--add",
|
|
171
|
+
"--cacheinfo",
|
|
172
|
+
`100644,${yield* Schema.decodeUnknownEffect(ObjectId)(String.trim(output)).pipe(Effect.mapError((cause) => failure(cause)))},.gitmodules`
|
|
173
|
+
]);
|
|
174
|
+
for (const reference of references) yield* run([
|
|
175
|
+
"update-index",
|
|
176
|
+
"--add",
|
|
177
|
+
"--cacheinfo",
|
|
178
|
+
`160000,${reference.commit},${reference.path}`
|
|
179
|
+
]);
|
|
180
|
+
});
|
|
181
|
+
return Service.of({ register });
|
|
182
|
+
}));
|
|
183
|
+
export { FdeDocsRecord, Record, Service, source_reference_exports as SourceReference, SourceReferenceError, fdeDocsRecord, files, initCommand, layer, record };
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=source-reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-reference.js","names":[],"sources":["../../src/create/source-reference.ts"],"sourcesContent":["import { mkdir } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\n\nimport { Array, Context, Effect, Layer, Redacted, Schema, Stream, String } from \"effect\";\n\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nexport const Record = Schema.Struct({\n commit: Schema.Literal(\"1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d\"),\n path: Schema.Literal(\"vendor/dual\"),\n url: Schema.Literal(\"git@git.datapizza.tech:dual/dual.git\"),\n});\nexport type Record = typeof Record.Type;\nexport const record: Record = {\n commit: \"1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d\",\n path: \"vendor/dual\",\n url: \"git@git.datapizza.tech:dual/dual.git\",\n};\n\nexport const FdeDocsRecord = Schema.Struct({\n commit: Schema.Literal(\"b7a1c2343758d77a55994ea1b7d5ac46f6547011\"),\n path: Schema.Literal(\"vendor/fdes-docs\"),\n url: Schema.Literal(\"git@git.datapizza.tech:dual/fdes-docs.git\"),\n});\nexport const fdeDocsRecord: typeof FdeDocsRecord.Type = {\n commit: \"b7a1c2343758d77a55994ea1b7d5ac46f6547011\",\n path: \"vendor/fdes-docs\",\n url: \"git@git.datapizza.tech:dual/fdes-docs.git\",\n};\nconst references = [record, fdeDocsRecord];\nexport const initCommand = `git submodule update --init -- ${Array.join(\n Array.map(references, reference => reference.path),\n \" \",\n)}`;\n\nexport const files = {\n \".gitmodules\": Array.join(\n Array.map(\n references,\n reference =>\n `[submodule \"${String.slice(\"vendor/\".length)(reference.path)}\"]\\n\\tpath = ${reference.path}\\n\\turl = ${reference.url}\\n\\tupdate = checkout\\n`,\n ),\n \"\",\n ),\n \"AGENTS.md\": `# Customer-owned Dual host\\n\\nBefore changing Dual host composition, plugins, or workflows, read\\n[DUAL-SOURCE.md](DUAL-SOURCE.md), then consult the relevant source and docs in\\n\\`vendor/dual\\`. If the checkout is absent, follow the explicit initialization\\ninstructions there. Treat that checkout as read-only reference; use the installed\\npublic \\`@dual/*\\` and \\`@dual-os/*\\` exports for application imports and verify APIs against the\\ninstalled package versions. Keep changes in this customer's workspace.\\n\\nBefore scoping customer requirements, designing use cases, or planning delivery,\\nread [FDE-DOCS.md](FDE-DOCS.md) for the read-only FDE guidance and access boundary.\\n`,\n \"DUAL-SOURCE.md\": `# Dual source reference\\n\nThis repository registers a real Git submodule at \\`${record.path}\\`, pinned to\n\\`${record.commit}\\` from \\`${record.url}\\`.\n\nIt is reference-only: never import it or use it as a runtime dependency or a\nworkspace dependency. Runtime packages come from the package registry; this\npinned source snapshot may differ from those packages.\n\nCreation requires Git but does not fetch source or contact the network for this\nreference, including during offline creation. Only .gitmodules and the pinned\ngitlinks are staged; no commit is created and application files and secrets are\nnot staged. Commit them separately after reviewing what you want to publish.\n\nTo obtain the private source, explicitly run:\n\n\\`\\`\\`sh\ngit submodule update --init -- vendor/dual\n\\`\\`\\`\n\nFor the separate FDE guidance, read [FDE-DOCS.md](FDE-DOCS.md).\n\\`bun run source:init\\` initializes both pinned references explicitly.\n\nSupply Git/SSH credentials externally. No credentials are generated or stored by\nthe scaffold. There are no recursive automatic submodule updates: do not use\n--recursive unless you deliberately want the source repository's own references.\n`,\n \"FDE-DOCS.md\": `# FDE documentation reference\\n\nThis repository registers a read-only Git submodule at \\`${fdeDocsRecord.path}\\`,\npinned to \\`${fdeDocsRecord.commit}\\` from \\`${fdeDocsRecord.url}\\` (master).\nThe branch identifies the pin's origin; initialization checks out the committed\nsnapshot, not the latest branch tip.\n\nFor customer requirements, use-case design and delivery planning, start with\n\\`vendor/fdes-docs/README.md\\` and \\`vendor/fdes-docs/FOLDER_STRUCTURE.md\\`, then\nconsult relevant guidance in \\`vendor/fdes-docs/AGENTS.md\\` and \\`vendor/fdes-docs/dualos/\\`.\nKeep customer implementation and deliverables in this workspace. The upstream\ninstructions describe a separate writable engagement repository: do not adopt\nits hook setup, workspace paths or write operations for this reference checkout.\n\nThe private repository includes other customers' material. Access to Dual does\nnot grant access to FDE docs or authorize reuse or disclosure of that material.\nConsult only material authorized for the current engagement. Read-only is a\nworkspace policy, not a Git permission restriction.\n\nCreation registers the gitlink without fetching or committing. To download only\nthis reference, configure external Git/SSH access to the FDE docs project and run:\n\n\\`\\`\\`sh\ngit submodule update --init -- vendor/fdes-docs\n\\`\\`\\`\n\n\\`bun run source:init\\` explicitly downloads both references without recursion.\nIf access fails, request project access and check SSH/network configuration;\nscaffolding and runtime packages do not depend on this checkout. Never import it\nor add it as a runtime or workspace dependency. No credentials are stored by the\nscaffold. See [DUAL-SOURCE.md](DUAL-SOURCE.md) for the product source reference.\n`,\n};\n\nexport class SourceReferenceError extends Schema.TaggedError<SourceReferenceError>()(\n \"SourceReferenceError\",\n { cause: Schema.Redacted(Schema.Defect()) },\n) {}\nconst failure = (cause: unknown) => new SourceReferenceError({ cause: Redacted.make(cause) });\nconst ObjectId = Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/));\n\nexport type Interface = {\n /** Register in a fresh, privately owned scaffold staging directory only. */\n readonly register: (staging: string) => Effect.Effect<void, SourceReferenceError>;\n};\nexport class Service extends Context.Service<Service, Interface>()(\n \"@dual-os/cli/SourceReference\",\n) {}\n\nexport const layer = Layer.effect(\n Service,\n Effect.gen(function* () {\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const register = Effect.fn(\"SourceReference.register\")(function* (staging: string) {\n const cwd = resolve(staging);\n // Exclusive creation refuses existing repositories and .git symlinks.\n yield* Effect.tryPromise({\n catch: failure,\n try: async () => {\n await mkdir(join(cwd, \".git\"));\n for (const reference of references) {\n await mkdir(join(cwd, reference.path), { recursive: true });\n }\n },\n }).pipe(Effect.uninterruptible);\n const nullDevice = process.platform === \"win32\" ? \"NUL\" : \"/dev/null\";\n // Replace, never extend, the inherited environment. In particular no GIT_*,\n // HOME/XDG config, loader injection, shell startup, or credential variables.\n // PATH selects the installed Git; SystemRoot is required by Windows.\n const env = {\n GIT_CONFIG_GLOBAL: nullDevice,\n GIT_CONFIG_NOSYSTEM: \"1\",\n GIT_CONFIG_SYSTEM: nullDevice,\n GIT_TERMINAL_PROMPT: \"0\",\n PATH: process.env[\"PATH\"],\n SystemRoot: process.platform === \"win32\" ? process.env[\"SystemRoot\"] : undefined,\n };\n const run = Effect.fn(\"SourceReference.git\")(\n function* (args: readonly string[], capture = false) {\n const handle = yield* spawner.spawn(\n ChildProcess.make(\n \"git\",\n [\n `--git-dir=${join(cwd, \".git\")}`,\n `--work-tree=${cwd}`,\n \"-c\",\n `core.hooksPath=${nullDevice}`,\n \"-c\",\n \"core.fsmonitor=false\",\n \"-c\",\n \"submodule.recurse=false\",\n \"-c\",\n \"protocol.allow=never\",\n ...args,\n ],\n {\n cwd,\n env,\n extendEnv: false,\n stderr: \"ignore\",\n stdin: \"ignore\",\n stdout: capture ? \"pipe\" : \"ignore\",\n },\n ),\n );\n const output = capture ? yield* Stream.mkString(Stream.decodeText(handle.stdout)) : \"\";\n const code = yield* handle.exitCode;\n if (code !== 0) return yield* failure({ exitCode: code });\n return output;\n },\n Effect.scoped,\n Effect.mapError(cause => failure(cause)),\n );\n yield* run([\n \"-c\",\n \"init.defaultBranch=main\",\n \"init\",\n \"--template=\",\n \"--object-format=sha1\",\n cwd,\n ]);\n // Hash without filters and register only .gitmodules and fixed gitlinks. Never `add .`:\n // user files, secrets, attributes, and external clean filters are excluded.\n const output = yield* run([\"hash-object\", \"-w\", \"--no-filters\", \"--\", \".gitmodules\"], true);\n const objectId = yield* Schema.decodeUnknownEffect(ObjectId)(String.trim(output)).pipe(\n Effect.mapError(cause => failure(cause)),\n );\n yield* run([\"update-index\", \"--add\", \"--cacheinfo\", `100644,${objectId},.gitmodules`]);\n for (const reference of references) {\n yield* run([\n \"update-index\",\n \"--add\",\n \"--cacheinfo\",\n `160000,${reference.commit},${reference.path}`,\n ]);\n }\n });\n return Service.of({ register });\n }),\n);\n\nexport * as SourceReference from \"./source-reference.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAa,SAAS,OAAO,OAAO;CAClC,QAAQ,OAAO,QAAQ,0CAA0C;CACjE,MAAM,OAAO,QAAQ,aAAa;CAClC,KAAK,OAAO,QAAQ,sCAAsC;AAC5D,CAAC;AAED,MAAa,SAAiB;CAC5B,QAAQ;CACR,MAAM;CACN,KAAK;AACP;AAEA,MAAa,gBAAgB,OAAO,OAAO;CACzC,QAAQ,OAAO,QAAQ,0CAA0C;CACjE,MAAM,OAAO,QAAQ,kBAAkB;CACvC,KAAK,OAAO,QAAQ,2CAA2C;AACjE,CAAC;AACD,MAAa,gBAA2C;CACtD,Q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AAa,YACtB,OAAO,IAAI;GACT;GACA;GACA;GACA,UAAU,UAAU,OAAO,GAAG,UAAU;EAC1C,CAAC;CAEL,CAAC;CACD,OAAO,QAAQ,GAAG,EAAE,SAAS,CAAC;AAChC,CAAC,CACH"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Selection } from "../release/release-manifest.js";
|
|
2
|
+
import { ResolvedSelection } from "./deployment.js";
|
|
3
|
+
import { Host } from "./choices.js";
|
|
4
|
+
import "./template.js";
|
|
5
|
+
import { Schema } from "effect";
|
|
6
|
+
declare namespace template_d_exports {
|
|
7
|
+
export { Replay, template_d_exports as Template, baseline, files, record, revision };
|
|
8
|
+
}
|
|
9
|
+
export declare const baseline: {
|
|
10
|
+
readonly "@deslop/coding-standards": "0.1.1222";
|
|
11
|
+
readonly "@dual/core": "0.0.1";
|
|
12
|
+
readonly "@dual/dualspec": "0.0.0";
|
|
13
|
+
readonly "@dual-os/sdk": "0.0.0";
|
|
14
|
+
readonly "@effect/platform-node": "4.1.2";
|
|
15
|
+
readonly "@effect/vitest": "4.1.2";
|
|
16
|
+
readonly "bun-types": "1.4.2";
|
|
17
|
+
readonly effect: "4.1.2";
|
|
18
|
+
readonly typescript: "7.0.2";
|
|
19
|
+
readonly vitest: "5.0.3";
|
|
20
|
+
};
|
|
21
|
+
export declare const revision = "customer-bun-v13";
|
|
22
|
+
export declare const Replay: Schema.Struct<{
|
|
23
|
+
readonly bootstrapVersion: Schema.Null;
|
|
24
|
+
readonly choices: Schema.Struct<{
|
|
25
|
+
readonly appId: Schema.String;
|
|
26
|
+
readonly name: Schema.String;
|
|
27
|
+
readonly packageName: Schema.String;
|
|
28
|
+
readonly packageScope: Schema.String;
|
|
29
|
+
readonly pluginId: Schema.String;
|
|
30
|
+
readonly slug: Schema.String;
|
|
31
|
+
readonly apiPort: Schema.Int;
|
|
32
|
+
readonly database: Schema.Literal<"postgresql">;
|
|
33
|
+
readonly email: Schema.Literals<readonly ["logging-only-no-delivery", "smtp"]>;
|
|
34
|
+
readonly fileStorage: Schema.Literals<readonly ["local", "s3"]>;
|
|
35
|
+
readonly hostname: Schema.String;
|
|
36
|
+
readonly httpPort: Schema.Int;
|
|
37
|
+
readonly postgresPort: Schema.Int;
|
|
38
|
+
readonly preset: Schema.Literals<readonly ["customer", "playground"]>;
|
|
39
|
+
readonly runtime: Schema.Literal<"bun">;
|
|
40
|
+
readonly telemetry: Schema.Literals<readonly ["opt-in", "disabled"]>;
|
|
41
|
+
readonly workspace: Schema.Literals<readonly ["just-bash", "opensandbox"]>;
|
|
42
|
+
readonly bare: Schema.Boolean;
|
|
43
|
+
}>;
|
|
44
|
+
readonly cliVersion: Schema.NonEmptyString;
|
|
45
|
+
readonly deployment: Schema.NullOr<Schema.Union<readonly [Schema.Struct<{
|
|
46
|
+
readonly pair: Schema.Struct<{
|
|
47
|
+
readonly commit: Schema.String;
|
|
48
|
+
readonly coreVersion: Schema.Literal<"0.0.1">;
|
|
49
|
+
readonly imageDigest: Schema.String;
|
|
50
|
+
readonly webImage: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.TemplateLiteral<readonly [Schema.String, "@", Schema.String]>, Schema.TemplateLiteral<readonly [Schema.String, ":", Schema.String, "@", Schema.String]>]>>;
|
|
51
|
+
}>;
|
|
52
|
+
readonly webImage: Schema.Union<readonly [Schema.String, Schema.TemplateLiteral<readonly [Schema.String, "@", Schema.String]>, Schema.TemplateLiteral<readonly [Schema.String, ":", Schema.String, "@", Schema.String]>]>;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly pair: Schema.Struct<{
|
|
55
|
+
readonly commit: Schema.String;
|
|
56
|
+
readonly coreVersion: Schema.String;
|
|
57
|
+
readonly imageDigest: Schema.String;
|
|
58
|
+
readonly webImage: Schema.Union<readonly [Schema.String, Schema.TemplateLiteral<readonly [Schema.String, "@", Schema.String]>, Schema.TemplateLiteral<readonly [Schema.String, ":", Schema.String, "@", Schema.String]>]>;
|
|
59
|
+
}>;
|
|
60
|
+
readonly webImage: Schema.Union<readonly [Schema.String, Schema.TemplateLiteral<readonly [Schema.String, "@", Schema.String]>, Schema.TemplateLiteral<readonly [Schema.String, ":", Schema.String, "@", Schema.String]>]>;
|
|
61
|
+
}>]>>;
|
|
62
|
+
readonly fdeDocsReference: Schema.Struct<{
|
|
63
|
+
readonly commit: Schema.Literal<"b7a1c2343758d77a55994ea1b7d5ac46f6547011">;
|
|
64
|
+
readonly path: Schema.Literal<"vendor/fdes-docs">;
|
|
65
|
+
readonly url: Schema.Literal<"git@git.datapizza.tech:dual/fdes-docs.git">;
|
|
66
|
+
}>;
|
|
67
|
+
readonly packages: Schema.$Record<Schema.String, Schema.String>;
|
|
68
|
+
readonly release: Schema.NullOr<Schema.Struct<{
|
|
69
|
+
readonly integrity: Schema.String;
|
|
70
|
+
readonly manifest: Schema.Struct<{
|
|
71
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
72
|
+
readonly version: Schema.String;
|
|
73
|
+
readonly commit: Schema.String;
|
|
74
|
+
readonly compatibility: Schema.Struct<{
|
|
75
|
+
readonly cli: Schema.NonEmptyString;
|
|
76
|
+
readonly template: Schema.NonEmptyString;
|
|
77
|
+
}>;
|
|
78
|
+
readonly packageManager: Schema.String;
|
|
79
|
+
readonly pair: Schema.Struct<{
|
|
80
|
+
readonly commit: Schema.String;
|
|
81
|
+
readonly coreVersion: Schema.String;
|
|
82
|
+
readonly imageDigest: Schema.String;
|
|
83
|
+
readonly webImage: Schema.Union<readonly [Schema.String, Schema.TemplateLiteral<readonly [Schema.String, "@", Schema.String]>, Schema.TemplateLiteral<readonly [Schema.String, ":", Schema.String, "@", Schema.String]>]>;
|
|
84
|
+
}>;
|
|
85
|
+
readonly packages: Schema.Struct<{
|
|
86
|
+
readonly "@dual/core": Schema.String;
|
|
87
|
+
readonly "@dual-os/sdk": Schema.String;
|
|
88
|
+
readonly "@dual/dualspec": Schema.String;
|
|
89
|
+
readonly "@dual/workspace-opensandbox": Schema.String;
|
|
90
|
+
readonly effect: Schema.String;
|
|
91
|
+
readonly "@effect/platform-node": Schema.String;
|
|
92
|
+
readonly "@effect/vitest": Schema.String;
|
|
93
|
+
readonly typescript: Schema.String;
|
|
94
|
+
readonly vitest: Schema.String;
|
|
95
|
+
readonly "bun-types": Schema.String;
|
|
96
|
+
readonly "@dual/ai-providers": Schema.optionalKey<Schema.String>;
|
|
97
|
+
readonly "@deslop/coding-standards": Schema.String;
|
|
98
|
+
}>;
|
|
99
|
+
}>;
|
|
100
|
+
}>>;
|
|
101
|
+
readonly schemaVersion: Schema.Literal<9>;
|
|
102
|
+
readonly sourceReference: Schema.Struct<{
|
|
103
|
+
readonly commit: Schema.Literal<"1c8ad1122f14e798e3084fc3bc40cbf6e548ac3d">;
|
|
104
|
+
readonly path: Schema.Literal<"vendor/dual">;
|
|
105
|
+
readonly url: Schema.Literal<"git@git.datapizza.tech:dual/dual.git">;
|
|
106
|
+
}>;
|
|
107
|
+
readonly template: Schema.Literal<"customer-bun-v13">;
|
|
108
|
+
}>;
|
|
109
|
+
export type Replay = typeof Replay.Type;
|
|
110
|
+
export declare const record: (versions: {
|
|
111
|
+
readonly cli: string;
|
|
112
|
+
}, bare: boolean, host: Host, deployment?: ResolvedSelection | null, release?: Selection | null) => Replay;
|
|
113
|
+
/** No environment, registry credentials, paths or timestamps enter the template. */
|
|
114
|
+
export declare const files: (input: Replay) => Promise<Record<string, string>>;
|
|
115
|
+
export { template_d_exports as Template };
|
|
116
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","names":["Choices.Host","Deployment.ResolvedSelection","ReleaseManifest.Selection"],"sources":["../../src/create/template.ts"],"mappings":";;;;;;;;qBAea;;;;;;;;;;;;qBAOA;qBACA,QAAM,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAyCP,gBAAgB,OAAO;qBACtB,SAAM;WACI;GAAa,eACrB,MACPA,MAAY,aACNC,0BAAmC,UACtCC,qBACR;;qBA0FU,QAAK,OAAiB,WAAS,QAAQ"}
|