@silvermoon-work/task-builder 0.1.0-canary-261111-1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +21 -2
- package/dist/init.js.map +1 -1
- package/examples/echo/src/main.ts +3 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -31,6 +31,9 @@ The library-only layout and init/CAR/tree APIs are published in
|
|
|
31
31
|
previous CLI layout; use the separate CLI package for commands.
|
|
32
32
|
Version `0.1.0-canary-261109-3` updates init to the migrated SDK with child
|
|
33
33
|
invocation support and removes all old-project development dependencies.
|
|
34
|
+
The `0.1.0-canary-261111-2` release updates init and the Echo example
|
|
35
|
+
to the breaking Space context API and selects the matching SDK. Rebuild old
|
|
36
|
+
canary Bundles before running them with the new Space host protocol.
|
|
34
37
|
|
|
35
38
|
## Transformation
|
|
36
39
|
|
|
@@ -230,6 +233,14 @@ text reference preserves string inference, while runtime Schemas require
|
|
|
230
233
|
nonempty text, integer bytes >=0 and chunks >=1, forbid extra input/result
|
|
231
234
|
properties, and disable messages. The TS contract is trusted executable code;
|
|
232
235
|
esbuild transpilation is not typechecking. JSON contracts remain supported.
|
|
236
|
+
The tree includes a standalone `tsconfig.json` for `src/**/*.ts`, using strict
|
|
237
|
+
NodeNext/ESM checking, ES2023 libraries and no output. It declares TypeScript
|
|
238
|
+
5.9.3 and `@types/node` 22.20.5 as development dependencies, matching the
|
|
239
|
+
repository catalog and Node 22 minimum. Dependency declarations are checked
|
|
240
|
+
too (`skipLibCheck` is not enabled). After installing, run
|
|
241
|
+
`pnpm exec tsc --project tsconfig.json`; the CLI adds `pnpm typecheck` as a
|
|
242
|
+
convenience script. Build remains independently usable transpilation, not a
|
|
243
|
+
typecheck gate.
|
|
233
244
|
The default dependency and author import use
|
|
234
245
|
`@silvermoon-work/task-sdk@0.1.0-canary-261109-2` in builder version
|
|
235
246
|
`0.1.0-canary-261109-3`. Older builder versions still emit the old SDK template;
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,gBAAgB,CA6IpF"}
|
package/dist/init.js
CHANGED
|
@@ -13,7 +13,7 @@ export function createTaskProject(options = {}) {
|
|
|
13
13
|
throw new Error(`Package name "${name}" produces an unsafe output path "${outDirectory}". Choose a package name without reserved device names or trailing dots.`);
|
|
14
14
|
const taskName = options.taskName ?? name.split("/").at(-1);
|
|
15
15
|
const minVersion = options.minRuntimeVersion ?? "22.13.0";
|
|
16
|
-
const sdkVersion = options.sdkVersion ?? "0.1.0
|
|
16
|
+
const sdkVersion = options.sdkVersion ?? "0.1.0";
|
|
17
17
|
if (!sdkVersion.trim() || [...sdkVersion].some((char) => char.charCodeAt(0) < 32))
|
|
18
18
|
throw new Error("Dependency specifiers must be nonempty without control characters.");
|
|
19
19
|
validateTaskBundle({
|
|
@@ -38,8 +38,25 @@ export function createTaskProject(options = {}) {
|
|
|
38
38
|
"@silvermoon-work/task-sdk": sdkVersion,
|
|
39
39
|
"@sinclair/typebox": "0.34.52",
|
|
40
40
|
},
|
|
41
|
+
devDependencies: {
|
|
42
|
+
"@types/node": "22.20.5",
|
|
43
|
+
typescript: "5.9.3",
|
|
44
|
+
},
|
|
41
45
|
}, null, 2)}\n`,
|
|
42
46
|
".gitignore": "node_modules/\ndist/\n*.car\n",
|
|
47
|
+
"tsconfig.json": `${JSON.stringify({
|
|
48
|
+
compilerOptions: {
|
|
49
|
+
target: "ES2023",
|
|
50
|
+
lib: ["ES2023"],
|
|
51
|
+
module: "NodeNext",
|
|
52
|
+
moduleResolution: "NodeNext",
|
|
53
|
+
strict: true,
|
|
54
|
+
verbatimModuleSyntax: true,
|
|
55
|
+
noEmit: true,
|
|
56
|
+
types: ["node"],
|
|
57
|
+
},
|
|
58
|
+
include: ["src/**/*.ts"],
|
|
59
|
+
}, null, 2)}\n`,
|
|
43
60
|
"task.build.yaml": stringify({
|
|
44
61
|
name: taskName,
|
|
45
62
|
runtime: { minVersion },
|
|
@@ -87,7 +104,9 @@ import type { Input, Result } from "./contract.js";
|
|
|
87
104
|
import { greet } from "./helper.js";
|
|
88
105
|
|
|
89
106
|
runTask<Input, Result>(async (input, context) => {
|
|
90
|
-
const
|
|
107
|
+
const greeting = await context.bundle.root.resolve("resources/greeting.txt").read();
|
|
108
|
+
if (greeting.kind !== "file") throw new Error("Expected greeting file.");
|
|
109
|
+
const reader = greeting.content.getReader();
|
|
91
110
|
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
92
111
|
let prefix = "";
|
|
93
112
|
let bytes = 0;
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,UAAU,EAAyB,MAAM,WAAW,CAAC;AAS9D,6FAA6F;AAC7F,MAAM,UAAU,iBAAiB,CAAC,UAA8B,EAAE;IAChE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,cAAc,CAAC;IAC5C,IACE,IAAI,CAAC,MAAM,GAAG,GAAG;QACjB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9C,CAAC,oDAAoD,CAAC,IAAI,CAAC,IAAI,CAAC;QAEhE,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,MAAM,YAAY,GAAG,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACxE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,YAAY,MAAM,CAAC;QAC7E,MAAM,IAAI,KAAK,CACb,iBAAiB,IAAI,qCAAqC,YAAY,0EAA0E,CACjJ,CAAC;IACJ,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC;IAC7D,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,IAAI,SAAS,CAAC;IAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":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F,IAAI;QACL,iBAAiB,EAAE,SAAS,CAAC;YAC3B,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,UAAU,EAAE;YACvB,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE;YAC/E,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC;YAClD,YAAY;YACZ,MAAM,EAAE,EAAE;SACX,CAAC;QACF,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BtB;QACG,eAAe,EAAE;;;CAGpB;QACG,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BlB;QACG,qBAAqB,EAAE,SAAS;KACjC,CAAC;IACF,OAAO,UAAU,CACf,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAChF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { runTask } from "@silvermoon-work/task-sdk";
|
|
2
2
|
|
|
3
3
|
runTask<{ text: string }, { text: string }>(async (input, context) => {
|
|
4
|
-
const
|
|
4
|
+
const node = await context.bundle.root.resolve("resources/greeting.txt").read();
|
|
5
|
+
if (node.kind !== "file") throw new Error("Expected greeting file.");
|
|
6
|
+
const reader = node.content.getReader();
|
|
5
7
|
const decoder = new TextDecoder();
|
|
6
8
|
let greeting = "";
|
|
7
9
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silvermoon-work/task-builder",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Task Bundle builds from read-only file trees with streaming resources.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"enhanced-resolve": "5.18.3",
|
|
51
51
|
"esbuild": "0.25.12",
|
|
52
52
|
"yaml": "2.9.1",
|
|
53
|
-
"@silvermoon-work/task-protocol": "0.1.0
|
|
53
|
+
"@silvermoon-work/task-protocol": "0.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@silvermoon-work/task-sdk": "0.1.0
|
|
56
|
+
"@silvermoon-work/task-sdk": "0.1.0"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|