create-windy 0.2.15 → 0.2.17

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.
Files changed (34) hide show
  1. package/dist/cli.js +23 -9
  2. package/package.json +1 -1
  3. package/template/.dockerignore +5 -0
  4. package/template/.windy-template.json +2 -2
  5. package/template/_gitignore +5 -0
  6. package/template/apps/server/Dockerfile +1 -2
  7. package/template/apps/web/Dockerfile +1 -2
  8. package/template/package.json +2 -1
  9. package/template/packages/ai-client/index.ts +1 -0
  10. package/template/packages/{agent-client → ai-client}/package.json +4 -5
  11. package/template/packages/{agent-client/src → ai-client/src/agent/client}/client.test.ts +3 -3
  12. package/template/packages/{agent-client/src → ai-client/src/agent/client}/client.ts +2 -2
  13. package/template/packages/{agent-client/src → ai-client/src/agent/client}/error.ts +1 -4
  14. package/template/packages/ai-client/src/agent/client/index.ts +3 -0
  15. package/template/packages/{agent-client/src → ai-client/src/agent/client}/run-protocol.test.ts +2 -2
  16. package/template/packages/{agent-client/src → ai-client/src/agent/client}/run.ts +1 -1
  17. package/template/packages/{agent-client/src → ai-client/src/agent/client}/types.ts +1 -1
  18. package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/contracts.test.ts +1 -1
  19. package/template/packages/ai-client/src/agent/contracts/index.ts +7 -0
  20. package/template/packages/ai-client/src/agent/index.ts +14 -0
  21. package/template/packages/{agent-client → ai-client}/tsconfig.json +3 -2
  22. package/template/packages/agent-client/index.ts +0 -3
  23. package/template/packages/agent-contracts/index.ts +0 -7
  24. package/template/packages/agent-contracts/package.json +0 -24
  25. package/template/packages/agent-contracts/tsconfig.json +0 -16
  26. /package/template/packages/{agent-client/src → ai-client/src/agent/client}/event-queue.ts +0 -0
  27. /package/template/packages/{agent-client/src → ai-client/src/agent/client}/http.ts +0 -0
  28. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/errors.ts +0 -0
  29. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/events.ts +0 -0
  30. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/operation.ts +0 -0
  31. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/runs.ts +0 -0
  32. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/sse.ts +0 -0
  33. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/usage.ts +0 -0
  34. /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/validation.ts +0 -0
package/dist/cli.js CHANGED
@@ -1585,8 +1585,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
1585
1585
  typecheck: [
1586
1586
  "bun run --cwd apps/web typecheck",
1587
1587
  "bun run --cwd apps/server typecheck",
1588
- "bun run --cwd packages/agent-contracts typecheck",
1589
- "bun run --cwd packages/agent-client typecheck",
1588
+ "bun run --cwd packages/ai-client typecheck",
1590
1589
  "bun run --cwd packages/jobs typecheck",
1591
1590
  "bun run --cwd packages/server-sdk typecheck",
1592
1591
  "bun run --cwd packages/storage typecheck",
@@ -1625,8 +1624,7 @@ var templateDirectories = [
1625
1624
  "apps/server",
1626
1625
  "apps/web",
1627
1626
  "examples",
1628
- "packages/agent-client",
1629
- "packages/agent-contracts",
1627
+ "packages/ai-client",
1630
1628
  "packages/config",
1631
1629
  "packages/crud-generator",
1632
1630
  "packages/database",
@@ -4013,7 +4011,9 @@ var recipes = [
4013
4011
  { id: "starter-0.2.11-to-0.2.12", from: "0.2.11", to: "0.2.12" },
4014
4012
  { id: "starter-0.2.12-to-0.2.13", from: "0.2.12", to: "0.2.13" },
4015
4013
  { id: "starter-0.2.13-to-0.2.14", from: "0.2.13", to: "0.2.14" },
4016
- { id: "starter-0.2.14-to-0.2.15", from: "0.2.14", to: "0.2.15" }
4014
+ { id: "starter-0.2.14-to-0.2.15", from: "0.2.14", to: "0.2.15" },
4015
+ { id: "starter-0.2.15-to-0.2.16", from: "0.2.15", to: "0.2.16" },
4016
+ { id: "starter-0.2.16-to-0.2.17", from: "0.2.16", to: "0.2.17" }
4017
4017
  ];
4018
4018
  function resolveRecipeChain(sourceVersion, targetVersion) {
4019
4019
  if (sourceVersion === targetVersion)
@@ -4106,6 +4106,7 @@ import { join as join14 } from "node:path";
4106
4106
 
4107
4107
  // src/update/known-repairs.ts
4108
4108
  var wrongTextVersions = new Set(["0.2.12", "0.2.13"]);
4109
+ var formattedBaselineVersions = new Set(["0.2.14", "0.2.15"]);
4109
4110
  var wrongExampleDescription = "创建时包含了 `work-order` 示例模块,用于演示 Module Manifest 接入;它不是生产工单产品,可以在正式开发前替换。";
4110
4111
  var correctCoreDescription = "创建时未选择 `work-order` 示例模块,当前项目只包含平台模块。";
4111
4112
  var wrongExampleRow = /^\|\s*示例工单\s*\|\s*已包含\s*\|$/m;
@@ -4117,10 +4118,9 @@ function repairKnownDerivedFile(input) {
4117
4118
  const targetRow = input.targetContent.match(correctCoreRow)?.[0];
4118
4119
  if (!targetRow)
4119
4120
  return;
4120
- if (input.sourceVersion === "0.2.14") {
4121
- const currentRow = input.content.match(correctCoreRow)?.[0];
4122
- if (input.content.includes(correctCoreDescription) && currentRow && currentRow !== targetRow) {
4123
- return input.content.replace(correctCoreRow, targetRow);
4121
+ if (formattedBaselineVersions.has(input.sourceVersion)) {
4122
+ if (input.content.includes(correctCoreDescription) && correctCoreRow.test(input.content) && input.content !== input.targetContent && normalizeMarkdownTables(input.content) === normalizeMarkdownTables(input.targetContent)) {
4123
+ return input.content;
4124
4124
  }
4125
4125
  return;
4126
4126
  }
@@ -4129,6 +4129,20 @@ function repairKnownDerivedFile(input) {
4129
4129
  }
4130
4130
  return input.content.replace(wrongExampleDescription, correctCoreDescription).replace(wrongExampleRow, targetRow);
4131
4131
  }
4132
+ function normalizeMarkdownTables(content) {
4133
+ return content.split(`
4134
+ `).map((line) => {
4135
+ const trimmed = line.trim();
4136
+ if (!trimmed.startsWith("|") || !trimmed.endsWith("|"))
4137
+ return line;
4138
+ return `| ${trimmed.slice(1, -1).split("|").map((cell) => normalizeTableCell(cell.trim())).join(" | ")} |`;
4139
+ }).join(`
4140
+ `);
4141
+ }
4142
+ function normalizeTableCell(cell) {
4143
+ const separator = cell.match(/^(:?)-{3,}(:?)$/);
4144
+ return separator ? `${separator[1]}---${separator[2]}` : cell;
4145
+ }
4132
4146
 
4133
4147
  // src/update/merge.ts
4134
4148
  import { mkdtemp as mkdtemp2, rm as rm6, writeFile as writeFile10 } from "node:fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-windy",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "创建单组织、单租户、私有部署优先的 Windy 企业 Dashboard Starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,10 @@
1
1
  **/dist
2
2
  **/node_modules
3
+ **/.mypy_cache
4
+ **/.pytest_cache
5
+ **/.ruff_cache
6
+ **/.venv
7
+ **/__pycache__
3
8
  .git
4
9
  .gitignore
5
10
  .husky
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "templateCommit": "04fdbd359b0f4159d1e3fe6c1a2ba148f2be73ce",
4
- "generatorVersion": "0.2.15",
3
+ "templateCommit": "b22121438a88c70146f3e37d9819a9df15b82ab9",
4
+ "generatorVersion": "0.2.17",
5
5
  "modules": [
6
6
  {
7
7
  "name": "system",
@@ -2,6 +2,11 @@
2
2
  .DS_Store
3
3
  node_modules/
4
4
  dist/
5
+ .mypy_cache/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ .venv/
9
+ __pycache__/
5
10
  packages/create-windy/template/
6
11
  .tmp/
7
12
  .windy/backups/
@@ -8,8 +8,7 @@ COPY apps/server/package.json apps/server/package.json
8
8
  COPY apps/web/package.json apps/web/package.json
9
9
  COPY apps/license/package.json apps/license/package.json
10
10
  COPY apps/signing-service/package.json apps/signing-service/package.json
11
- COPY packages/agent-client/package.json packages/agent-client/package.json
12
- COPY packages/agent-contracts/package.json packages/agent-contracts/package.json
11
+ COPY packages/ai-client/package.json packages/ai-client/package.json
13
12
  COPY packages/config/package.json packages/config/package.json
14
13
  COPY packages/create-windy/package.json packages/create-windy/package.json
15
14
  COPY packages/crud-generator/package.json packages/crud-generator/package.json
@@ -8,8 +8,7 @@ COPY apps/license/package.json apps/license/package.json
8
8
  COPY apps/server/package.json apps/server/package.json
9
9
  COPY apps/signing-service/package.json apps/signing-service/package.json
10
10
  COPY apps/web/package.json apps/web/package.json
11
- COPY packages/agent-client/package.json packages/agent-client/package.json
12
- COPY packages/agent-contracts/package.json packages/agent-contracts/package.json
11
+ COPY packages/ai-client/package.json packages/ai-client/package.json
13
12
  COPY packages/config/package.json packages/config/package.json
14
13
  COPY packages/create-windy/package.json packages/create-windy/package.json
15
14
  COPY packages/crud-generator/package.json packages/crud-generator/package.json
@@ -38,7 +38,8 @@
38
38
  "ops:release": "bun run scripts/production-release.ts",
39
39
  "test:release:evidence": "bun run scripts/release-evidence.ts",
40
40
  "test:packages:pack": "bun run scripts/platform-package-release.ts",
41
- "typecheck": "bun run --cwd apps/web typecheck && bun run --cwd apps/server typecheck && bun run --cwd apps/license typecheck && bun run --cwd apps/signing-service typecheck && bun run --cwd packages/agent-contracts typecheck && bun run --cwd packages/agent-client typecheck && bun run --cwd packages/license-sdk typecheck && bun run --cwd packages/jobs typecheck && bun run --cwd packages/server-sdk typecheck && bun run --cwd packages/storage typecheck && bun run --cwd packages/database typecheck && bun run --cwd packages/crud-generator typecheck && bun run --cwd packages/create-windy typecheck",
41
+ "test:agent": "uv run --directory apps/agent-server pytest && uv run --directory apps/agent-server ruff check . && uv run --directory apps/agent-server ruff format --check . && uv run --directory apps/agent-server mypy",
42
+ "typecheck": "bun run --cwd apps/web typecheck && bun run --cwd apps/server typecheck && bun run --cwd apps/license typecheck && bun run --cwd apps/signing-service typecheck && bun run --cwd packages/ai-client typecheck && bun run --cwd packages/license-sdk typecheck && bun run --cwd packages/jobs typecheck && bun run --cwd packages/server-sdk typecheck && bun run --cwd packages/storage typecheck && bun run --cwd packages/database typecheck && bun run --cwd packages/crud-generator typecheck && bun run --cwd packages/create-windy typecheck",
42
43
  "lint": "oxlint .",
43
44
  "format": "oxfmt",
44
45
  "format:staged": "lint-staged",
@@ -0,0 +1 @@
1
+ export * from "./src/agent/index.js";
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@southwind-ai/agent-client",
2
+ "name": "@southwind-ai/ai-client",
3
3
  "version": "0.1.0",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
@@ -15,11 +15,10 @@
15
15
  "test": "bun test",
16
16
  "typecheck": "tsc --noEmit --project tsconfig.json"
17
17
  },
18
- "dependencies": {
19
- "@southwind-ai/agent-contracts": "workspace:*"
20
- },
21
18
  "exports": {
22
- ".": "./index.ts"
19
+ ".": "./index.ts",
20
+ "./agent": "./src/agent/index.ts",
21
+ "./contracts": "./src/agent/contracts/index.ts"
23
22
  },
24
23
  "publishConfig": {
25
24
  "access": "public"
@@ -2,8 +2,8 @@ import { describe, expect, test } from "bun:test";
2
2
  import {
3
3
  defineAgentOperation,
4
4
  type AgentEvent,
5
- } from "@southwind-ai/agent-contracts";
6
- import { createAgentCaller } from "../index.js";
5
+ } from "@southwind-ai/ai-client/contracts";
6
+ import { createAgentCaller } from "@southwind-ai/ai-client";
7
7
  import { AgentClientError } from "./error.js";
8
8
  import type { AgentFetch } from "./types.js";
9
9
 
@@ -29,7 +29,7 @@ const operation = defineAgentOperation<{ text: string }, { answer: string }>(
29
29
  },
30
30
  );
31
31
 
32
- describe("@southwind-ai/agent-client", () => {
32
+ describe("@southwind-ai/ai-client", () => {
33
33
  test("创建 Run、消费可恢复 SSE,并在 completed 后读取类型化结果", async () => {
34
34
  const fake = plannedFetch([
35
35
  () =>
@@ -1,8 +1,8 @@
1
1
  import type {
2
2
  AgentOperation,
3
3
  StartAgentRunRequest,
4
- } from "@southwind-ai/agent-contracts";
5
- import { parseStartAgentRunResponse } from "@southwind-ai/agent-contracts";
4
+ } from "../contracts/index.js";
5
+ import { parseStartAgentRunResponse } from "../contracts/index.js";
6
6
  import { AgentClientError, requestError, safeHttpError } from "./error.js";
7
7
  import { safeJson } from "./http.js";
8
8
  import { HttpAgentRun } from "./run.js";
@@ -1,7 +1,4 @@
1
- import {
2
- parseAgentError,
3
- type AgentError,
4
- } from "@southwind-ai/agent-contracts";
1
+ import { parseAgentError, type AgentError } from "../contracts/index.js";
5
2
 
6
3
  export type AgentClientErrorCode =
7
4
  | "INVALID_CONFIGURATION"
@@ -0,0 +1,3 @@
1
+ export * from "./client.js";
2
+ export * from "./error.js";
3
+ export type * from "./types.js";
@@ -2,8 +2,8 @@ import { describe, expect, test } from "bun:test";
2
2
  import {
3
3
  defineAgentOperation,
4
4
  type AgentEvent,
5
- } from "@southwind-ai/agent-contracts";
6
- import { createAgentCaller } from "../index.js";
5
+ } from "@southwind-ai/ai-client/contracts";
6
+ import { createAgentCaller } from "@southwind-ai/ai-client/agent";
7
7
  import type { AgentFetch } from "./types.js";
8
8
 
9
9
  const operation = defineAgentOperation<null, string>("agent.test", (value) => {
@@ -4,7 +4,7 @@ import {
4
4
  splitAgentSseFrames,
5
5
  type AgentEvent,
6
6
  type TerminalAgentEvent,
7
- } from "@southwind-ai/agent-contracts";
7
+ } from "../contracts/index.js";
8
8
  import { AgentClientError, requestError, safeHttpError } from "./error.js";
9
9
  import { EventQueue } from "./event-queue.js";
10
10
  import { safeJson } from "./http.js";
@@ -1,4 +1,4 @@
1
- import type { AgentEvent, AgentOperation } from "@southwind-ai/agent-contracts";
1
+ import type { AgentEvent, AgentOperation } from "../contracts/index.js";
2
2
 
3
3
  export interface StartAgentRunOptions {
4
4
  idempotencyKey: string;
@@ -13,7 +13,7 @@ import {
13
13
  parseAgentUsage,
14
14
  splitAgentSseFrames,
15
15
  type AgentEvent,
16
- } from "../index.js";
16
+ } from "@southwind-ai/ai-client/contracts";
17
17
 
18
18
  const error = {
19
19
  code: "RUNTIME_UNAVAILABLE",
@@ -0,0 +1,7 @@
1
+ export * from "./errors.js";
2
+ export * from "./events.js";
3
+ export * from "./operation.js";
4
+ export * from "./runs.js";
5
+ export * from "./sse.js";
6
+ export * from "./usage.js";
7
+ export { AgentContractParseError } from "./validation.js";
@@ -0,0 +1,14 @@
1
+ export * from "./client/index.js";
2
+ export {
3
+ defineAgentOperation,
4
+ isTerminalAgentEvent,
5
+ type AgentError,
6
+ type AgentErrorCode,
7
+ type AgentEvent,
8
+ type AgentOperation,
9
+ type AgentOperationInput,
10
+ type AgentOperationOutput,
11
+ type AgentRunStatus,
12
+ type AgentUsage,
13
+ type TerminalAgentEvent,
14
+ } from "./contracts/index.js";
@@ -6,8 +6,9 @@
6
6
  "moduleResolution": "bundler",
7
7
  "baseUrl": ".",
8
8
  "paths": {
9
- "@southwind-ai/agent-contracts": ["../agent-contracts/index.ts"],
10
- "@southwind-ai/storage": ["../storage/index.ts"]
9
+ "@southwind-ai/ai-client": ["./index.ts"],
10
+ "@southwind-ai/ai-client/agent": ["./src/agent/index.ts"],
11
+ "@southwind-ai/ai-client/contracts": ["./src/agent/contracts/index.ts"]
11
12
  },
12
13
  "strict": true,
13
14
  "noImplicitAny": true,
@@ -1,3 +0,0 @@
1
- export * from "./src/client.js";
2
- export * from "./src/error.js";
3
- export type * from "./src/types.js";
@@ -1,7 +0,0 @@
1
- export * from "./src/errors.js";
2
- export * from "./src/events.js";
3
- export * from "./src/operation.js";
4
- export * from "./src/runs.js";
5
- export * from "./src/sse.js";
6
- export * from "./src/usage.js";
7
- export { AgentContractParseError } from "./src/validation.js";
@@ -1,24 +0,0 @@
1
- {
2
- "name": "@southwind-ai/agent-contracts",
3
- "version": "0.1.0",
4
- "license": "UNLICENSED",
5
- "type": "module",
6
- "engines": {
7
- "bun": ">=1.3.0"
8
- },
9
- "files": [
10
- "index.ts",
11
- "src/**/*.ts",
12
- "!src/**/*.test.ts"
13
- ],
14
- "scripts": {
15
- "test": "bun test",
16
- "typecheck": "tsc --noEmit --project tsconfig.json"
17
- },
18
- "exports": {
19
- ".": "./index.ts"
20
- },
21
- "publishConfig": {
22
- "access": "public"
23
- }
24
- }
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "lib": ["esnext", "dom"],
6
- "moduleResolution": "bundler",
7
- "strict": true,
8
- "noImplicitAny": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true,
11
- "outDir": "dist",
12
- "types": ["bun"]
13
- },
14
- "include": ["src/**/*", "index.ts"],
15
- "exclude": ["node_modules", "dist"]
16
- }