@mawaru/sdk 0.5.0 → 0.8.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.
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { jsonSchemaSchema, portKeySchema } from "./node.js";
3
+ import { manifestInKeysViolation } from "./port-spec.js";
3
4
  // nodes/program/<dir>/config.json(リポジトリ規約 v2)。プログラム自身が入出力スキーマを宣言し、
4
5
  // エディタが取り込んで ports を自動生成する(実行時の正は ports テーブルのまま。
5
6
  // docs/tasks/wip/プログラムのリポジトリ規約v2(ディレクトリ+config.json).md)。
@@ -22,14 +23,11 @@ export const programManifestSchema = z
22
23
  refs: z.record(portKeySchema, jsonSchemaSchema).default({}),
23
24
  })
24
25
  .superRefine((manifest, ctx) => {
25
- // グラフ側の既存制約(in ポートちょうど1つ・key "in" 固定)に整合させる
26
- const inKeys = Object.keys(manifest.inputs);
27
- if (inKeys.length !== 1 || inKeys[0] !== "in") {
28
- ctx.addIssue({
29
- code: "custom",
30
- path: ["inputs"],
31
- message: 'inputs は "in" の1件だけ宣言してください(join 導入まで)',
32
- });
26
+ // in の構成は kind が固定する(program は "in" の1口)。ルールの正は
27
+ // port-spec 側で、ここは参照するだけ
28
+ const inViolation = manifestInKeysViolation("program", Object.keys(manifest.inputs));
29
+ if (inViolation) {
30
+ ctx.addIssue({ code: "custom", path: ["inputs"], message: inViolation });
33
31
  }
34
32
  if (Object.keys(manifest.outputs).length < 1) {
35
33
  ctx.addIssue({
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./_schemas/ai-manifest.js";
2
+ export * from "./_schemas/extract-component.js";
2
3
  export * from "./_schemas/graph.js";
3
4
  export * from "./_schemas/hook-manifest.js";
4
5
  export * from "./_schemas/node.js";
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // 正はここ(npm 公開)で、@mawaru/common(private)が re-export して
3
3
  // backend / frontend が使う。CLI(typegen / validate)の実装は export しない
4
4
  export * from "./_schemas/ai-manifest.js";
5
+ export * from "./_schemas/extract-component.js";
5
6
  export * from "./_schemas/graph.js";
6
7
  export * from "./_schemas/hook-manifest.js";
7
8
  export * from "./_schemas/node.js";
package/dist/init.js CHANGED
@@ -64,6 +64,9 @@ export const runInit = (root) => {
64
64
  }
65
65
  writeIfAbsent("CLAUDE.md", template("CLAUDE.md"));
66
66
  writeIfAbsent("README.md", template("README.md"));
67
+ // テンプレートのファイル名を .gitignore にすると npm pack 時に無視ルールとして
68
+ // 作用してしまうため、ドット無しの "gitignore" で持つ
69
+ writeIfAbsent(".gitignore", template("gitignore"));
67
70
  // package.json:@mawaru/sdk を devDependencies に(ポインタ・docs の参照解決と
68
71
  // typegen / validate CLI のため)。バージョンはこのパッケージ自身から取る
69
72
  const sdkVersion = JSON.parse(readFileSync(join(packageRoot(), "package.json"), "utf-8")).version;
package/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  // 正はここ(npm 公開)で、@mawaru/common(private)が re-export して
3
3
  // backend / frontend が使う。CLI(typegen / validate)の実装は export しない
4
4
  export * from "./_schemas/ai-manifest.js"
5
+ export * from "./_schemas/extract-component.js"
5
6
  export * from "./_schemas/graph.js"
6
7
  export * from "./_schemas/hook-manifest.js"
7
8
  export * from "./_schemas/node.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mawaru/sdk",
3
- "version": "0.5.0",
3
+ "version": "0.8.0",
4
4
  "description": "mawaru 実行 repo の開発 SDK。契約スキーマ(config.json 規約・ループ graph API)の正 + typegen / validate CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ # mawaru の API キー等(create-loop スキルが生成する。コミット禁止)
3
+ .env
4
+ .DS_Store