@webpresso/agent-kit 0.23.0 → 0.24.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/dist/esm/audit/cloudflare-deploy-contract.js +17 -1
- package/dist/esm/e2e/config.d.ts +9 -0
- package/dist/esm/e2e/config.js +12 -0
- package/dist/esm/e2e/load-host-adapter.d.ts +6 -1
- package/dist/esm/e2e/load-host-adapter.js +27 -9
- package/package.json +6 -6
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Webpresso agent-kit Claude Code plugin: blueprints, skills, hooks, MCP server",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.24.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
]
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"version": "0.
|
|
26
|
+
"version": "0.24.0"
|
|
27
27
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { loadWebpressoConfigSafe } from '#e2e/load-host-adapter';
|
|
4
4
|
function violation(file, message) {
|
|
5
5
|
return { file, message };
|
|
6
6
|
}
|
|
7
|
+
function readProductionMetadata(metadataPath) {
|
|
8
|
+
return JSON.parse(readFileSync(metadataPath, 'utf8'));
|
|
9
|
+
}
|
|
7
10
|
export async function auditCloudflareDeployContract(root) {
|
|
8
11
|
let loaded;
|
|
9
12
|
try {
|
|
@@ -33,6 +36,19 @@ export async function auditCloudflareDeployContract(root) {
|
|
|
33
36
|
if (!existsSync(metadataPath)) {
|
|
34
37
|
violations.push(violation(configPath, `shared deploy contract requires ${cloudflare.production.metadataPath} to exist`));
|
|
35
38
|
}
|
|
39
|
+
else {
|
|
40
|
+
try {
|
|
41
|
+
const metadata = readProductionMetadata(metadataPath);
|
|
42
|
+
if (metadata.durableObjectMigration === 'required' &&
|
|
43
|
+
metadata.rolloutMode !== 'direct') {
|
|
44
|
+
violations.push(violation(cloudflare.production.metadataPath, 'Durable Object migration releases must use rolloutMode "direct"'));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
violations.push(violation(cloudflare.production.metadataPath, `production release metadata must be valid JSON: ${message}`));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
36
52
|
for (const target of cloudflare.targets) {
|
|
37
53
|
const isDurableObjectTarget = (target.durableObjectBindings?.length ?? 0) > 0;
|
|
38
54
|
if (target.previewTransport === 'custom_domain_env' && !target.routeSpec) {
|
package/dist/esm/e2e/config.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const WEBPRESSO_CONFIG_FILE_NAME = "webpresso.config.ts";
|
|
3
3
|
export declare const WEBPRESSO_CONFIG_EXPORT_NAME = "webpressoConfig";
|
|
4
|
+
export declare const AGENT_KIT_CONFIG_FILE_NAME = "agent-kit.config.ts";
|
|
5
|
+
export declare const AGENT_KIT_CONFIG_EXPORT_NAME = "agentKitConfig";
|
|
6
|
+
export declare const WEBPRESSO_CONFIG_CANDIDATES: readonly [{
|
|
7
|
+
readonly fileName: "agent-kit.config.ts";
|
|
8
|
+
readonly exportName: "agentKitConfig";
|
|
9
|
+
}, {
|
|
10
|
+
readonly fileName: "webpresso.config.ts";
|
|
11
|
+
readonly exportName: "webpressoConfig";
|
|
12
|
+
}];
|
|
4
13
|
declare const webpressoConfigSchema: z.ZodObject<{
|
|
5
14
|
e2e: z.ZodOptional<z.ZodObject<{
|
|
6
15
|
hostAdapterModule: z.ZodString;
|
package/dist/esm/e2e/config.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const WEBPRESSO_CONFIG_FILE_NAME = 'webpresso.config.ts';
|
|
3
3
|
export const WEBPRESSO_CONFIG_EXPORT_NAME = 'webpressoConfig';
|
|
4
|
+
export const AGENT_KIT_CONFIG_FILE_NAME = 'agent-kit.config.ts';
|
|
5
|
+
export const AGENT_KIT_CONFIG_EXPORT_NAME = 'agentKitConfig';
|
|
6
|
+
export const WEBPRESSO_CONFIG_CANDIDATES = [
|
|
7
|
+
{
|
|
8
|
+
fileName: AGENT_KIT_CONFIG_FILE_NAME,
|
|
9
|
+
exportName: AGENT_KIT_CONFIG_EXPORT_NAME,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
fileName: WEBPRESSO_CONFIG_FILE_NAME,
|
|
13
|
+
exportName: WEBPRESSO_CONFIG_EXPORT_NAME,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
4
16
|
const wranglerEnvNameSchema = z
|
|
5
17
|
.string()
|
|
6
18
|
.min(1, 'wranglerEnvName must not be empty.')
|
|
@@ -19,7 +19,12 @@ export declare class WebpressoConfigLoadError extends Error {
|
|
|
19
19
|
}
|
|
20
20
|
export declare class WebpressoConfigExportError extends Error {
|
|
21
21
|
readonly configPath: string;
|
|
22
|
-
|
|
22
|
+
readonly exportName: string;
|
|
23
|
+
constructor(configPath: string, exportName?: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class WebpressoConfigAmbiguousError extends Error {
|
|
26
|
+
readonly configPaths: readonly string[];
|
|
27
|
+
constructor(configPaths: readonly string[]);
|
|
23
28
|
}
|
|
24
29
|
export declare class HostAdapterModuleLoadError extends Error {
|
|
25
30
|
readonly moduleSpecifier: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { dirname, resolve, parse } from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
|
-
import { WEBPRESSO_CONFIG_EXPORT_NAME, WEBPRESSO_CONFIG_FILE_NAME, validateWebpressoConfig, } from './config.js';
|
|
4
|
+
import { WEBPRESSO_CONFIG_CANDIDATES, WEBPRESSO_CONFIG_EXPORT_NAME, WEBPRESSO_CONFIG_FILE_NAME, validateWebpressoConfig, } from './config.js';
|
|
5
5
|
import { FALLBACK_HOST_ADAPTER_EXPORT_NAMES, isE2eHostAdapter } from './host-adapter.js';
|
|
6
6
|
export class WebpressoConfigLoadError extends Error {
|
|
7
7
|
configPath;
|
|
@@ -15,12 +15,22 @@ export class WebpressoConfigLoadError extends Error {
|
|
|
15
15
|
}
|
|
16
16
|
export class WebpressoConfigExportError extends Error {
|
|
17
17
|
configPath;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
exportName;
|
|
19
|
+
constructor(configPath, exportName = WEBPRESSO_CONFIG_EXPORT_NAME) {
|
|
20
|
+
super(`Expected config at ${configPath} to export ${exportName}.`);
|
|
20
21
|
this.configPath = configPath;
|
|
22
|
+
this.exportName = exportName;
|
|
21
23
|
this.name = 'WebpressoConfigExportError';
|
|
22
24
|
}
|
|
23
25
|
}
|
|
26
|
+
export class WebpressoConfigAmbiguousError extends Error {
|
|
27
|
+
configPaths;
|
|
28
|
+
constructor(configPaths) {
|
|
29
|
+
super(`Multiple Webpresso config files found: ${configPaths.join(', ')}`);
|
|
30
|
+
this.configPaths = configPaths;
|
|
31
|
+
this.name = 'WebpressoConfigAmbiguousError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
24
34
|
export class HostAdapterModuleLoadError extends Error {
|
|
25
35
|
moduleSpecifier;
|
|
26
36
|
configPath;
|
|
@@ -55,9 +65,12 @@ export function resolveWebpressoConfigPath(cwd = process.cwd()) {
|
|
|
55
65
|
}
|
|
56
66
|
export function findWebpressoConfigPath(cwd = process.cwd()) {
|
|
57
67
|
for (const searchDir of getSearchDirectories(cwd)) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
68
|
+
const configPaths = WEBPRESSO_CONFIG_CANDIDATES.map((candidate) => resolve(searchDir, candidate.fileName)).filter((configPath) => existsSync(configPath));
|
|
69
|
+
if (configPaths.length > 1) {
|
|
70
|
+
throw new WebpressoConfigAmbiguousError(configPaths);
|
|
71
|
+
}
|
|
72
|
+
if (configPaths.length === 1) {
|
|
73
|
+
return configPaths[0];
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
return null;
|
|
@@ -67,11 +80,12 @@ export async function loadWebpressoConfig(options = {}) {
|
|
|
67
80
|
const configModule = await loadModuleNamespace(pathToFileURL(configPath).href, (cause) => {
|
|
68
81
|
throw new WebpressoConfigLoadError(configPath, cause);
|
|
69
82
|
});
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
const exportName = expectedConfigExportName(configPath);
|
|
84
|
+
if (!(exportName in configModule)) {
|
|
85
|
+
throw new WebpressoConfigExportError(configPath, exportName);
|
|
72
86
|
}
|
|
73
87
|
return {
|
|
74
|
-
config: validateWebpressoConfig(configModule[
|
|
88
|
+
config: validateWebpressoConfig(configModule[exportName], configPath),
|
|
75
89
|
configPath,
|
|
76
90
|
};
|
|
77
91
|
}
|
|
@@ -138,6 +152,10 @@ function resolveModuleSpecifier(moduleSpecifier, configPath) {
|
|
|
138
152
|
}
|
|
139
153
|
return moduleSpecifier;
|
|
140
154
|
}
|
|
155
|
+
function expectedConfigExportName(configPath) {
|
|
156
|
+
const candidate = WEBPRESSO_CONFIG_CANDIDATES.find((item) => configPath.endsWith(item.fileName));
|
|
157
|
+
return candidate?.exportName ?? WEBPRESSO_CONFIG_EXPORT_NAME;
|
|
158
|
+
}
|
|
141
159
|
async function loadModuleNamespace(moduleSpecifier, onError) {
|
|
142
160
|
try {
|
|
143
161
|
const moduleNamespace = await import(moduleSpecifier);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpresso/agent-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -696,10 +696,10 @@
|
|
|
696
696
|
},
|
|
697
697
|
"packageManager": "pnpm@11.1.1",
|
|
698
698
|
"optionalDependencies": {
|
|
699
|
-
"@webpresso/agent-kit-runtime-darwin-arm64": "0.
|
|
700
|
-
"@webpresso/agent-kit-runtime-darwin-x64": "0.
|
|
701
|
-
"@webpresso/agent-kit-runtime-linux-x64": "0.
|
|
702
|
-
"@webpresso/agent-kit-runtime-linux-arm64": "0.
|
|
703
|
-
"@webpresso/agent-kit-runtime-windows-x64": "0.
|
|
699
|
+
"@webpresso/agent-kit-runtime-darwin-arm64": "0.24.0",
|
|
700
|
+
"@webpresso/agent-kit-runtime-darwin-x64": "0.24.0",
|
|
701
|
+
"@webpresso/agent-kit-runtime-linux-x64": "0.24.0",
|
|
702
|
+
"@webpresso/agent-kit-runtime-linux-arm64": "0.24.0",
|
|
703
|
+
"@webpresso/agent-kit-runtime-windows-x64": "0.24.0"
|
|
704
704
|
}
|
|
705
705
|
}
|