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.
- package/dist/cli.js +23 -9
- package/package.json +1 -1
- package/template/.dockerignore +5 -0
- package/template/.windy-template.json +2 -2
- package/template/_gitignore +5 -0
- package/template/apps/server/Dockerfile +1 -2
- package/template/apps/web/Dockerfile +1 -2
- package/template/package.json +2 -1
- package/template/packages/ai-client/index.ts +1 -0
- package/template/packages/{agent-client → ai-client}/package.json +4 -5
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/client.test.ts +3 -3
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/client.ts +2 -2
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/error.ts +1 -4
- package/template/packages/ai-client/src/agent/client/index.ts +3 -0
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/run-protocol.test.ts +2 -2
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/run.ts +1 -1
- package/template/packages/{agent-client/src → ai-client/src/agent/client}/types.ts +1 -1
- package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/contracts.test.ts +1 -1
- package/template/packages/ai-client/src/agent/contracts/index.ts +7 -0
- package/template/packages/ai-client/src/agent/index.ts +14 -0
- package/template/packages/{agent-client → ai-client}/tsconfig.json +3 -2
- package/template/packages/agent-client/index.ts +0 -3
- package/template/packages/agent-contracts/index.ts +0 -7
- package/template/packages/agent-contracts/package.json +0 -24
- package/template/packages/agent-contracts/tsconfig.json +0 -16
- /package/template/packages/{agent-client/src → ai-client/src/agent/client}/event-queue.ts +0 -0
- /package/template/packages/{agent-client/src → ai-client/src/agent/client}/http.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/errors.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/events.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/operation.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/runs.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/sse.ts +0 -0
- /package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/usage.ts +0 -0
- /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/
|
|
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/
|
|
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
|
|
4121
|
-
|
|
4122
|
-
|
|
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
package/template/.dockerignore
CHANGED
package/template/_gitignore
CHANGED
|
@@ -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/
|
|
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/
|
|
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
|
package/template/package.json
CHANGED
|
@@ -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
|
-
"
|
|
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/
|
|
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/
|
|
6
|
-
import { createAgentCaller } from "
|
|
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/
|
|
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 "
|
|
5
|
-
import { parseStartAgentRunResponse } from "
|
|
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";
|
package/template/packages/{agent-client/src → ai-client/src/agent/client}/run-protocol.test.ts
RENAMED
|
@@ -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/
|
|
6
|
-
import { createAgentCaller } from "
|
|
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 "
|
|
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";
|
|
@@ -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/
|
|
10
|
-
"@southwind-ai/
|
|
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,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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/operation.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/template/packages/{agent-contracts/src → ai-client/src/agent/contracts}/validation.ts
RENAMED
|
File without changes
|