alchemy 0.1.11 → 0.1.13
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 +324 -0
- package/lib/$.d.ts +8 -3
- package/lib/$.d.ts.map +1 -1
- package/lib/$.js +38 -27
- package/lib/$.js.map +1 -1
- package/lib/alchemize.d.ts.map +1 -1
- package/lib/alchemize.js +7 -0
- package/lib/alchemize.js.map +1 -1
- package/lib/apply.d.ts +2 -2
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +3 -3
- package/lib/apply.js.map +1 -1
- package/lib/aws/index.d.ts +1 -0
- package/lib/aws/index.d.ts.map +1 -1
- package/lib/aws/index.js +1 -0
- package/lib/aws/index.js.map +1 -1
- package/lib/aws/ses.d.ts +75 -0
- package/lib/aws/ses.d.ts.map +1 -0
- package/lib/aws/ses.js +197 -0
- package/lib/aws/ses.js.map +1 -0
- package/lib/cloudflare/api.d.ts +88 -0
- package/lib/cloudflare/api.d.ts.map +1 -0
- package/lib/cloudflare/api.js +184 -0
- package/lib/cloudflare/api.js.map +1 -0
- package/lib/cloudflare/asset-manifest.d.ts +15 -0
- package/lib/cloudflare/asset-manifest.d.ts.map +1 -0
- package/lib/cloudflare/asset-manifest.js +2 -0
- package/lib/cloudflare/asset-manifest.js.map +1 -0
- package/lib/cloudflare/auth.d.ts +52 -0
- package/lib/cloudflare/auth.d.ts.map +1 -0
- package/lib/cloudflare/auth.js +114 -0
- package/lib/cloudflare/auth.js.map +1 -0
- package/lib/cloudflare/bindings.d.ts +254 -0
- package/lib/cloudflare/bindings.d.ts.map +1 -0
- package/lib/cloudflare/bindings.js +2 -0
- package/lib/cloudflare/bindings.js.map +1 -0
- package/lib/cloudflare/durable-object-namespace.d.ts +23 -0
- package/lib/cloudflare/durable-object-namespace.d.ts.map +1 -0
- package/lib/cloudflare/durable-object-namespace.js +26 -0
- package/lib/cloudflare/durable-object-namespace.js.map +1 -0
- package/lib/cloudflare/generate-asset-manifest.d.ts +3 -0
- package/lib/cloudflare/generate-asset-manifest.d.ts.map +1 -0
- package/lib/cloudflare/generate-asset-manifest.js +69 -0
- package/lib/cloudflare/generate-asset-manifest.js.map +1 -0
- package/lib/cloudflare/index.d.ts +7 -0
- package/lib/cloudflare/index.d.ts.map +1 -0
- package/lib/cloudflare/index.js +7 -0
- package/lib/cloudflare/index.js.map +1 -0
- package/lib/cloudflare/kv-namespace.d.ts +61 -0
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -0
- package/lib/cloudflare/kv-namespace.js +93 -0
- package/lib/cloudflare/kv-namespace.js.map +1 -0
- package/lib/cloudflare/state.d.ts +83 -0
- package/lib/cloudflare/state.d.ts.map +1 -0
- package/lib/cloudflare/state.js +109 -0
- package/lib/cloudflare/state.js.map +1 -0
- package/lib/cloudflare/static-site-router.d.ts +19 -0
- package/lib/cloudflare/static-site-router.d.ts.map +1 -0
- package/lib/cloudflare/static-site-router.js +110 -0
- package/lib/cloudflare/static-site-router.js.map +1 -0
- package/lib/cloudflare/static-site.d.ts +166 -0
- package/lib/cloudflare/static-site.d.ts.map +1 -0
- package/lib/cloudflare/static-site.js +168 -0
- package/lib/cloudflare/static-site.js.map +1 -0
- package/lib/cloudflare/types.d.ts +52 -0
- package/lib/cloudflare/types.d.ts.map +1 -0
- package/lib/cloudflare/types.js +21 -0
- package/lib/cloudflare/types.js.map +1 -0
- package/lib/cloudflare/upload-asset-manifest.d.ts +12 -0
- package/lib/cloudflare/upload-asset-manifest.d.ts.map +1 -0
- package/lib/cloudflare/upload-asset-manifest.js +55 -0
- package/lib/cloudflare/upload-asset-manifest.js.map +1 -0
- package/lib/cloudflare/worker-metadata.d.ts +130 -0
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -0
- package/lib/cloudflare/worker-metadata.js +2 -0
- package/lib/cloudflare/worker-metadata.js.map +1 -0
- package/lib/cloudflare/worker-migration.d.ts +110 -0
- package/lib/cloudflare/worker-migration.d.ts.map +1 -0
- package/lib/cloudflare/worker-migration.js +11 -0
- package/lib/cloudflare/worker-migration.js.map +1 -0
- package/lib/cloudflare/worker.d.ts +105 -0
- package/lib/cloudflare/worker.d.ts.map +1 -0
- package/lib/cloudflare/worker.js +358 -0
- package/lib/cloudflare/worker.js.map +1 -0
- package/lib/destroy.d.ts +1 -1
- package/lib/destroy.d.ts.map +1 -1
- package/lib/destroy.js +2 -1
- package/lib/destroy.js.map +1 -1
- package/lib/esbuild.d.ts +83 -1
- package/lib/esbuild.d.ts.map +1 -1
- package/lib/esbuild.js +27 -18
- package/lib/esbuild.js.map +1 -1
- package/lib/fs.d.ts +1 -1
- package/lib/global.d.ts +0 -2
- package/lib/global.d.ts.map +1 -1
- package/lib/global.js +3 -3
- package/lib/global.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/main.js +1 -1
- package/lib/main.js.map +1 -1
- package/lib/output.d.ts +18 -13
- package/lib/output.d.ts.map +1 -1
- package/lib/output.js +12 -5
- package/lib/output.js.map +1 -1
- package/lib/print.d.ts +7 -0
- package/lib/print.d.ts.map +1 -0
- package/lib/print.js +10 -0
- package/lib/print.js.map +1 -0
- package/lib/resource.d.ts +9 -4
- package/lib/resource.d.ts.map +1 -1
- package/lib/resource.js +127 -93
- package/lib/resource.js.map +1 -1
- package/lib/scope.d.ts +3 -0
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +4 -12
- package/lib/scope.js.map +1 -1
- package/lib/utils/content-type.d.ts +8 -0
- package/lib/utils/content-type.d.ts.map +1 -0
- package/lib/utils/content-type.js +41 -0
- package/lib/utils/content-type.js.map +1 -0
- package/package.json +27 -8
- package/src/$.ts +63 -30
- package/src/alchemize.ts +12 -0
- package/src/apply.ts +6 -6
- package/src/aws/index.ts +1 -0
- package/src/aws/ses.ts +346 -0
- package/src/cloudflare/api.ts +282 -0
- package/src/cloudflare/asset-manifest.ts +16 -0
- package/src/cloudflare/auth.ts +187 -0
- package/src/cloudflare/bindings.ts +297 -0
- package/src/cloudflare/durable-object-namespace.ts +43 -0
- package/src/cloudflare/generate-asset-manifest.ts +93 -0
- package/src/cloudflare/index.ts +6 -0
- package/src/cloudflare/kv-namespace.ts +195 -0
- package/src/cloudflare/state.ts +138 -0
- package/src/cloudflare/static-site-router.ts +150 -0
- package/src/cloudflare/static-site.ts +395 -0
- package/src/cloudflare/types.ts +71 -0
- package/src/cloudflare/upload-asset-manifest.ts +83 -0
- package/src/cloudflare/worker-metadata.ts +154 -0
- package/src/cloudflare/worker-migration.ts +145 -0
- package/src/cloudflare/worker.ts +666 -0
- package/src/destroy.ts +2 -2
- package/src/esbuild.ts +34 -22
- package/src/global.ts +1 -3
- package/src/index.ts +1 -1
- package/src/main.ts +1 -1
- package/src/output.ts +53 -37
- package/src/print.ts +18 -0
- package/src/resource.ts +163 -116
- package/src/scope.ts +7 -12
- package/src/utils/content-type.ts +42 -0
- package/lib/agent/ai.d.ts +0 -40
- package/lib/agent/ai.d.ts.map +0 -1
- package/lib/agent/ai.js +0 -132
- package/lib/agent/ai.js.map +0 -1
- package/lib/agent/anthropic.d.ts +0 -9
- package/lib/agent/anthropic.d.ts.map +0 -1
- package/lib/agent/anthropic.js +0 -25
- package/lib/agent/anthropic.js.map +0 -1
- package/lib/agent/dependencies.d.ts +0 -4
- package/lib/agent/dependencies.d.ts.map +0 -1
- package/lib/agent/dependencies.js +0 -48
- package/lib/agent/dependencies.js.map +0 -1
- package/lib/agent/file-context.d.ts +0 -13
- package/lib/agent/file-context.d.ts.map +0 -1
- package/lib/agent/file-context.js +0 -6
- package/lib/agent/file-context.js.map +0 -1
- package/lib/agent/index.d.ts +0 -10
- package/lib/agent/index.d.ts.map +0 -1
- package/lib/agent/index.js +0 -10
- package/lib/agent/index.js.map +0 -1
- package/lib/agent/model.d.ts +0 -8
- package/lib/agent/model.d.ts.map +0 -1
- package/lib/agent/model.js +0 -29
- package/lib/agent/model.js.map +0 -1
- package/lib/agent/module.d.ts +0 -81
- package/lib/agent/module.d.ts.map +0 -1
- package/lib/agent/module.js +0 -309
- package/lib/agent/module.js.map +0 -1
- package/lib/agent/openai.d.ts +0 -6
- package/lib/agent/openai.d.ts.map +0 -1
- package/lib/agent/openai.js +0 -41
- package/lib/agent/openai.js.map +0 -1
- package/lib/agent/program.d.ts +0 -12
- package/lib/agent/program.d.ts.map +0 -1
- package/lib/agent/program.js +0 -21
- package/lib/agent/program.js.map +0 -1
- package/lib/agent/prompts.d.ts +0 -4
- package/lib/agent/prompts.d.ts.map +0 -1
- package/lib/agent/prompts.js +0 -11
- package/lib/agent/prompts.js.map +0 -1
- package/lib/agent/scrape.d.ts +0 -71
- package/lib/agent/scrape.d.ts.map +0 -1
- package/lib/agent/scrape.js +0 -45
- package/lib/agent/scrape.js.map +0 -1
- package/lib/aws/auto/docs.d.ts +0 -11
- package/lib/aws/auto/docs.d.ts.map +0 -1
- package/lib/aws/auto/docs.js +0 -56
- package/lib/aws/auto/docs.js.map +0 -1
- package/lib/aws/auto/index.d.ts +0 -5
- package/lib/aws/auto/index.d.ts.map +0 -1
- package/lib/aws/auto/index.js +0 -5
- package/lib/aws/auto/index.js.map +0 -1
- package/lib/aws/auto/resource.d.ts +0 -24
- package/lib/aws/auto/resource.d.ts.map +0 -1
- package/lib/aws/auto/resource.js +0 -194
- package/lib/aws/auto/resource.js.map +0 -1
- package/lib/aws/auto/service.d.ts +0 -10
- package/lib/aws/auto/service.d.ts.map +0 -1
- package/lib/aws/auto/service.js +0 -34
- package/lib/aws/auto/service.js.map +0 -1
- package/lib/aws/auto/spec.d.ts +0 -83
- package/lib/aws/auto/spec.d.ts.map +0 -1
- package/lib/aws/auto/spec.js +0 -58
- package/lib/aws/auto/spec.js.map +0 -1
- package/lib/markdown/design.d.ts +0 -17
- package/lib/markdown/design.d.ts.map +0 -1
- package/lib/markdown/design.js +0 -92
- package/lib/markdown/design.js.map +0 -1
- package/lib/markdown/extract.d.ts +0 -7
- package/lib/markdown/extract.d.ts.map +0 -1
- package/lib/markdown/extract.js +0 -10
- package/lib/markdown/extract.js.map +0 -1
- package/lib/markdown/index.d.ts +0 -4
- package/lib/markdown/index.d.ts.map +0 -1
- package/lib/markdown/index.js +0 -4
- package/lib/markdown/index.js.map +0 -1
- package/lib/markdown/requirements.d.ts +0 -79
- package/lib/markdown/requirements.d.ts.map +0 -1
- package/lib/markdown/requirements.js +0 -105
- package/lib/markdown/requirements.js.map +0 -1
- package/lib/typescript/check-omission.d.ts +0 -2
- package/lib/typescript/check-omission.d.ts.map +0 -1
- package/lib/typescript/check-omission.js +0 -43
- package/lib/typescript/check-omission.js.map +0 -1
- package/lib/typescript/debug-type-errors.d.ts +0 -3
- package/lib/typescript/debug-type-errors.d.ts.map +0 -1
- package/lib/typescript/debug-type-errors.js +0 -35
- package/lib/typescript/debug-type-errors.js.map +0 -1
- package/lib/typescript/extract.d.ts +0 -7
- package/lib/typescript/extract.d.ts.map +0 -1
- package/lib/typescript/extract.js +0 -10
- package/lib/typescript/extract.js.map +0 -1
- package/lib/typescript/index.d.ts +0 -7
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/index.js +0 -7
- package/lib/typescript/index.js.map +0 -1
- package/lib/typescript/install-dependencies.d.ts +0 -29
- package/lib/typescript/install-dependencies.d.ts.map +0 -1
- package/lib/typescript/install-dependencies.js +0 -52
- package/lib/typescript/install-dependencies.js.map +0 -1
- package/lib/typescript/package.d.ts +0 -157
- package/lib/typescript/package.d.ts.map +0 -1
- package/lib/typescript/package.js +0 -115
- package/lib/typescript/package.js.map +0 -1
- package/lib/typescript/repair-omissions.d.ts +0 -3
- package/lib/typescript/repair-omissions.d.ts.map +0 -1
- package/lib/typescript/repair-omissions.js +0 -23
- package/lib/typescript/repair-omissions.js.map +0 -1
- package/lib/typescript/repair.d.ts +0 -3
- package/lib/typescript/repair.d.ts.map +0 -1
- package/lib/typescript/repair.js +0 -34
- package/lib/typescript/repair.js.map +0 -1
- package/lib/typescript/tsconfig.d.ts +0 -469
- package/lib/typescript/tsconfig.d.ts.map +0 -1
- package/lib/typescript/tsconfig.js +0 -143
- package/lib/typescript/tsconfig.js.map +0 -1
- package/lib/typescript/typescript.d.ts +0 -107
- package/lib/typescript/typescript.d.ts.map +0 -1
- package/lib/typescript/typescript.js +0 -180
- package/lib/typescript/typescript.js.map +0 -1
- package/lib/typescript/validate.d.ts +0 -10
- package/lib/typescript/validate.d.ts.map +0 -1
- package/lib/typescript/validate.js +0 -49
- package/lib/typescript/validate.js.map +0 -1
- package/src/agent/ai.ts +0 -215
- package/src/agent/anthropic.ts +0 -31
- package/src/agent/dependencies.ts +0 -62
- package/src/agent/file-context.ts +0 -8
- package/src/agent/index.ts +0 -9
- package/src/agent/model.ts +0 -39
- package/src/agent/module.ts +0 -418
- package/src/agent/openai.ts +0 -50
- package/src/agent/program.md +0 -38
- package/src/agent/program.ts +0 -37
- package/src/agent/prompts.ts +0 -20
- package/src/agent/scrape.ts +0 -47
- package/src/aws/auto/cfn.json +0 -225310
- package/src/aws/auto/docs.ts +0 -73
- package/src/aws/auto/index.ts +0 -4
- package/src/aws/auto/resource.ts +0 -269
- package/src/aws/auto/service.ts +0 -51
- package/src/aws/auto/spec.ts +0 -160
- package/src/markdown/design.ts +0 -125
- package/src/markdown/extract.ts +0 -9
- package/src/markdown/index.ts +0 -3
- package/src/markdown/requirements.ts +0 -135
- package/src/typescript/check-omission.ts +0 -47
- package/src/typescript/debug-type-errors.ts +0 -42
- package/src/typescript/extract.ts +0 -9
- package/src/typescript/index.ts +0 -6
- package/src/typescript/install-dependencies.ts +0 -61
- package/src/typescript/package.ts +0 -143
- package/src/typescript/repair-omissions.ts +0 -31
- package/src/typescript/repair.ts +0 -45
- package/src/typescript/tsconfig.ts +0 -170
- package/src/typescript/typescript.ts +0 -217
- package/src/typescript/validate.ts +0 -73
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ReasoningEffort: z.ZodEnum<["low", "medium", "high"]>;
|
|
3
|
-
export declare const RequirementsInput: z.ZodObject<{
|
|
4
|
-
/**
|
|
5
|
-
* The ID of the model to use for generating requirements documentation
|
|
6
|
-
* @default "gpt-4o"
|
|
7
|
-
*/
|
|
8
|
-
modelId: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["o3-mini", "o1", "o1-2024-12-17", "o1-mini", "o1-mini-2024-09-12", "o1-preview", "o1-preview-2024-09-12", "gpt-4o", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-2024-11-20", "gpt-4o-audio-preview", "gpt-4o-audio-preview-2024-10-01", "gpt-4o-audio-preview-2024-12-17", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-turbo-preview", "gpt-4-0125-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-0613", "gpt-3.5-turbo-0125", "gpt-3.5-turbo", "gpt-3.5-turbo-1106"]>, z.ZodEnum<["claude-3-5-sonnet-latest", "claude-3-5-sonnet-20241022", "claude-3-5-sonnet-20240620", "claude-3-5-haiku-latest", "claude-3-5-haiku-20241022", "claude-3-opus", "claude-3-opus-20240229", "claude-3-sonnet", "claude-3-sonnet-20240229", "claude-3-haiku", "claude-3-haiku-20240307"]>]>>;
|
|
9
|
-
/**
|
|
10
|
-
* The effort to put into reasoning about the requirements
|
|
11
|
-
*/
|
|
12
|
-
reasoningEffort: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
13
|
-
/**
|
|
14
|
-
* List of requirements to document and analyze
|
|
15
|
-
*/
|
|
16
|
-
requirements: z.ZodArray<z.ZodString, "many">;
|
|
17
|
-
/**
|
|
18
|
-
* List of dependencies for the requirements document
|
|
19
|
-
*/
|
|
20
|
-
dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
21
|
-
path: z.ZodString;
|
|
22
|
-
content: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
path: string;
|
|
25
|
-
content?: string | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
path: string;
|
|
28
|
-
content?: string | undefined;
|
|
29
|
-
}>, "many">>;
|
|
30
|
-
/**
|
|
31
|
-
* Temperature setting for model generation (higher = more creative, lower = more focused)
|
|
32
|
-
* @default 0.7
|
|
33
|
-
*/
|
|
34
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
/**
|
|
36
|
-
* File path where the requirements document should be written
|
|
37
|
-
*/
|
|
38
|
-
file: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
requirements: string[];
|
|
41
|
-
temperature?: number | undefined;
|
|
42
|
-
file?: string | undefined;
|
|
43
|
-
reasoningEffort?: "high" | "low" | "medium" | undefined;
|
|
44
|
-
modelId?: "o3-mini" | "o1" | "o1-2024-12-17" | "o1-mini" | "o1-mini-2024-09-12" | "o1-preview" | "o1-preview-2024-09-12" | "gpt-4o" | "gpt-4o-2024-05-13" | "gpt-4o-2024-08-06" | "gpt-4o-2024-11-20" | "gpt-4o-audio-preview" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-mini" | "gpt-4o-mini-2024-07-18" | "gpt-4-turbo" | "gpt-4-turbo-2024-04-09" | "gpt-4-turbo-preview" | "gpt-4-0125-preview" | "gpt-4-1106-preview" | "gpt-4" | "gpt-4-0613" | "gpt-3.5-turbo-0125" | "gpt-3.5-turbo" | "gpt-3.5-turbo-1106" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-5-sonnet-20240620" | "claude-3-5-haiku-latest" | "claude-3-5-haiku-20241022" | "claude-3-opus" | "claude-3-opus-20240229" | "claude-3-sonnet" | "claude-3-sonnet-20240229" | "claude-3-haiku" | "claude-3-haiku-20240307" | undefined;
|
|
45
|
-
dependencies?: {
|
|
46
|
-
path: string;
|
|
47
|
-
content?: string | undefined;
|
|
48
|
-
}[] | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
requirements: string[];
|
|
51
|
-
temperature?: number | undefined;
|
|
52
|
-
file?: string | undefined;
|
|
53
|
-
reasoningEffort?: "high" | "low" | "medium" | undefined;
|
|
54
|
-
modelId?: "o3-mini" | "o1" | "o1-2024-12-17" | "o1-mini" | "o1-mini-2024-09-12" | "o1-preview" | "o1-preview-2024-09-12" | "gpt-4o" | "gpt-4o-2024-05-13" | "gpt-4o-2024-08-06" | "gpt-4o-2024-11-20" | "gpt-4o-audio-preview" | "gpt-4o-audio-preview-2024-10-01" | "gpt-4o-audio-preview-2024-12-17" | "gpt-4o-mini" | "gpt-4o-mini-2024-07-18" | "gpt-4-turbo" | "gpt-4-turbo-2024-04-09" | "gpt-4-turbo-preview" | "gpt-4-0125-preview" | "gpt-4-1106-preview" | "gpt-4" | "gpt-4-0613" | "gpt-3.5-turbo-0125" | "gpt-3.5-turbo" | "gpt-3.5-turbo-1106" | "claude-3-5-sonnet-latest" | "claude-3-5-sonnet-20241022" | "claude-3-5-sonnet-20240620" | "claude-3-5-haiku-latest" | "claude-3-5-haiku-20241022" | "claude-3-opus" | "claude-3-opus-20240229" | "claude-3-sonnet" | "claude-3-sonnet-20240229" | "claude-3-haiku" | "claude-3-haiku-20240307" | undefined;
|
|
55
|
-
dependencies?: {
|
|
56
|
-
path: string;
|
|
57
|
-
content?: string | undefined;
|
|
58
|
-
}[] | undefined;
|
|
59
|
-
}>;
|
|
60
|
-
export declare const RequirementsOutput: z.ZodObject<{
|
|
61
|
-
/**
|
|
62
|
-
* Generated markdown document containing organized and analyzed requirements
|
|
63
|
-
*/
|
|
64
|
-
content: z.ZodString;
|
|
65
|
-
}, "strip", z.ZodTypeAny, {
|
|
66
|
-
content: string;
|
|
67
|
-
}, {
|
|
68
|
-
content: string;
|
|
69
|
-
}>;
|
|
70
|
-
export interface RequirementsInput extends z.infer<typeof RequirementsInput> {
|
|
71
|
-
}
|
|
72
|
-
export type RequirementsOutput = z.infer<typeof RequirementsOutput>;
|
|
73
|
-
declare const Requirements_base: import("../resource").Provider<"code::Requirements", [props: RequirementsInput], {
|
|
74
|
-
content: string;
|
|
75
|
-
}>;
|
|
76
|
-
export declare class Requirements extends Requirements_base {
|
|
77
|
-
}
|
|
78
|
-
export {};
|
|
79
|
-
//# sourceMappingURL=requirements.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../../src/markdown/requirements.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,eAAe,sCAAoC,CAAC;AAEjE,eAAO,MAAM,iBAAiB;IAC5B;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,eAAO,MAAM,kBAAkB;IAC7B;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC;CAAG;AAC/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;;;;AAEpE,qBAAa,YAAa,SAAQ,iBA2EjC;CAAG"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
2
|
-
import { dirname } from "path";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { FileContext, ModelId, dependenciesAsMessages, generateText, resolveModel, } from "../agent";
|
|
5
|
-
import { rm } from "../fs";
|
|
6
|
-
import { Resource } from "../resource";
|
|
7
|
-
export const ReasoningEffort = z.enum(["low", "medium", "high"]);
|
|
8
|
-
export const RequirementsInput = z.object({
|
|
9
|
-
/**
|
|
10
|
-
* The ID of the model to use for generating requirements documentation
|
|
11
|
-
* @default "gpt-4o"
|
|
12
|
-
*/
|
|
13
|
-
modelId: ModelId.optional(),
|
|
14
|
-
/**
|
|
15
|
-
* The effort to put into reasoning about the requirements
|
|
16
|
-
*/
|
|
17
|
-
reasoningEffort: ReasoningEffort.optional(),
|
|
18
|
-
/**
|
|
19
|
-
* List of requirements to document and analyze
|
|
20
|
-
*/
|
|
21
|
-
requirements: z.array(z.string()),
|
|
22
|
-
/**
|
|
23
|
-
* List of dependencies for the requirements document
|
|
24
|
-
*/
|
|
25
|
-
dependencies: z.array(FileContext).optional(),
|
|
26
|
-
/**
|
|
27
|
-
* Temperature setting for model generation (higher = more creative, lower = more focused)
|
|
28
|
-
* @default 0.7
|
|
29
|
-
*/
|
|
30
|
-
temperature: z.number().optional(),
|
|
31
|
-
/**
|
|
32
|
-
* File path where the requirements document should be written
|
|
33
|
-
*/
|
|
34
|
-
file: z.string().optional(),
|
|
35
|
-
});
|
|
36
|
-
export const RequirementsOutput = z.object({
|
|
37
|
-
/**
|
|
38
|
-
* Generated markdown document containing organized and analyzed requirements
|
|
39
|
-
*/
|
|
40
|
-
content: z.string(),
|
|
41
|
-
});
|
|
42
|
-
export class Requirements extends Resource("code::Requirements", async (ctx, props) => {
|
|
43
|
-
if (ctx.event === "delete") {
|
|
44
|
-
if (props.file) {
|
|
45
|
-
await rm(props.file);
|
|
46
|
-
}
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (props.file) {
|
|
50
|
-
console.log(ctx.event === "create" ? "Designing" : "Revising", "requirements", props.file);
|
|
51
|
-
}
|
|
52
|
-
// Get the appropriate model based on the ID
|
|
53
|
-
const model = await resolveModel(props.modelId ?? "gpt-4o");
|
|
54
|
-
// Generate the requirements document
|
|
55
|
-
const { text } = await generateText({
|
|
56
|
-
model,
|
|
57
|
-
temperature: props.temperature ?? 0.7,
|
|
58
|
-
maxSteps: 3, // Allow multiple steps for potential tool usage
|
|
59
|
-
providerOptions: props.reasoningEffort
|
|
60
|
-
? {
|
|
61
|
-
openai: {
|
|
62
|
-
reasoningEffort: props.reasoningEffort,
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
: undefined,
|
|
66
|
-
tools: {
|
|
67
|
-
// scrapeWebPage,
|
|
68
|
-
},
|
|
69
|
-
messages: [
|
|
70
|
-
{
|
|
71
|
-
role: "system",
|
|
72
|
-
content: "You are a helpful assistant that creates markdown documents from requirements. You can use the scrapeWebPage tool to get additional requirements from relevant URLs if needed.",
|
|
73
|
-
},
|
|
74
|
-
...dependenciesAsMessages(props.dependencies ?? []),
|
|
75
|
-
{
|
|
76
|
-
role: "user",
|
|
77
|
-
content: `Please analyze the following system requirements and create a comprehensive, unambiguous markdown document that covers all aspects:
|
|
78
|
-
|
|
79
|
-
Requirements:
|
|
80
|
-
${props.requirements.map((req) => `- ${req}`).join("\n")}
|
|
81
|
-
|
|
82
|
-
Guidelines:
|
|
83
|
-
1. Make explicit decisions for any ambiguous requirements - do not leave open questions
|
|
84
|
-
2. Document the reasoning behind key decisions
|
|
85
|
-
3. Be specific about technical choices and implementation details
|
|
86
|
-
4. Avoid phrases like "could be", "might need", or "possibly requires" - be definitive
|
|
87
|
-
5. Organize requirements into logical sections with clear dependencies and relationships
|
|
88
|
-
|
|
89
|
-
Format the output in markdown with appropriate headers, lists, and sections, starting with the title as an H1 header.
|
|
90
|
-
Include technical considerations and implementation details, ensuring every requirement has a clear, actionable specification.`,
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
});
|
|
94
|
-
if (props.file) {
|
|
95
|
-
// Ensure the directory exists
|
|
96
|
-
await mkdir(dirname(props.file), { recursive: true });
|
|
97
|
-
// Write the requirements to the file
|
|
98
|
-
await writeFile(props.file, text);
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
content: text,
|
|
102
|
-
};
|
|
103
|
-
}) {
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=requirements.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requirements.js","s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,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,8BAA8B;QAC9B,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEtD,qCAAqC;QACrC,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC,CACF;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-omission.d.ts","sourceRoot":"","sources":["../../src/typescript/check-omission.ts"],"names":[],"mappings":"AAWA,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAmCzE"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { generateObject } from "../agent/ai";
|
|
3
|
-
import { resolveModel } from "../agent/model";
|
|
4
|
-
const CodeOmissionCheck = z.object({
|
|
5
|
-
hasOmittedCode: z.boolean(),
|
|
6
|
-
explanation: z.string(),
|
|
7
|
-
});
|
|
8
|
-
const haiku = await resolveModel("claude-3-5-haiku-latest");
|
|
9
|
-
export async function checkForCodeOmission(code) {
|
|
10
|
-
const result = await generateObject({
|
|
11
|
-
model: haiku,
|
|
12
|
-
schema: CodeOmissionCheck,
|
|
13
|
-
temperature: 0.1,
|
|
14
|
-
messages: [
|
|
15
|
-
{
|
|
16
|
-
role: "system",
|
|
17
|
-
content: "You are checking for signs of code omission in TypeScript code. Look for comments that indicate abbreviated or omitted content.",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
role: "user",
|
|
21
|
-
content: `Check this code for any signs of content being lazily omitted:
|
|
22
|
-
|
|
23
|
-
\`\`\`typescript
|
|
24
|
-
${code}
|
|
25
|
-
\`\`\`
|
|
26
|
-
|
|
27
|
-
Look for patterns like:
|
|
28
|
-
- "// rest of the ..."
|
|
29
|
-
- "// remaining code ..."
|
|
30
|
-
- "// ... existing code ..."
|
|
31
|
-
- "// other methods ..."
|
|
32
|
-
- "// etc ..."
|
|
33
|
-
- "// Implementation would go here"
|
|
34
|
-
- "// For now just ..."
|
|
35
|
-
- Any similar comments that indicate code was abbreviated
|
|
36
|
-
|
|
37
|
-
Only answer true if you find such comments indicating omitted content. Otherwise answer false.`,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
});
|
|
41
|
-
return result.object.hasOmittedCode;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=check-omission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-omission.js","sourceRoot":"","sources":["../../src/typescript/check-omission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,yBAAyB,CAAC,CAAC;AAE5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAY;IACrD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;QAClC,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,iBAAiB;QACzB,WAAW,EAAE,GAAG;QAChB,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,QAAQ;gBACd,OAAO,EACL,iIAAiI;aACpI;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;;;EAGf,IAAI;;;;;;;;;;;;;+FAayF;aACxF;SACF;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;AACtC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug-type-errors.d.ts","sourceRoot":"","sources":["../../src/typescript/debug-type-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAItC,wBAAsB,eAAe,CACnC,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { generateText } from "../agent/ai";
|
|
2
|
-
import { resolveModel } from "../agent/model";
|
|
3
|
-
export async function debugTypeErrors(messages, typeErrors) {
|
|
4
|
-
const o3Model = await resolveModel("o3-mini");
|
|
5
|
-
// Get diagnostic analysis from o3-mini
|
|
6
|
-
const consultationMessages = [
|
|
7
|
-
...messages,
|
|
8
|
-
{
|
|
9
|
-
role: "user",
|
|
10
|
-
content: `Analyze these TypeScript errors and the code to identify the root causes:
|
|
11
|
-
|
|
12
|
-
TypeScript errors:
|
|
13
|
-
${typeErrors}
|
|
14
|
-
|
|
15
|
-
Please help by:
|
|
16
|
-
1. Diagnosing the root cause of any type errors
|
|
17
|
-
2. Identifying specific sections of code that need to change
|
|
18
|
-
3. Providing step-by-step guidance on how to fix them
|
|
19
|
-
|
|
20
|
-
Focus only on type-related issues and necessary fixes.`,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
const { text: analysis } = await generateText({
|
|
24
|
-
model: o3Model,
|
|
25
|
-
temperature: 0.1,
|
|
26
|
-
providerOptions: {
|
|
27
|
-
openai: {
|
|
28
|
-
reasoningEffort: "high",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
messages: consultationMessages,
|
|
32
|
-
});
|
|
33
|
-
return analysis;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=debug-type-errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug-type-errors.js","sourceRoot":"","sources":["../../src/typescript/debug-type-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,QAAuB,EACvB,UAAkB;IAElB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;IAE9C,uCAAuC;IACvC,MAAM,oBAAoB,GAAkB;QAC1C,GAAG,QAAQ;QACX;YACE,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE;;;EAGb,UAAU;;;;;;;uDAO2C;SAClD;KACF,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,CAAC;QAC5C,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,GAAG;QAChB,eAAe,EAAE;YACf,MAAM,EAAE;gBACN,eAAe,EAAE,MAAM;aACxB;SACF;QACD,QAAQ,EAAE,oBAAoB;KAC/B,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts TypeScript code from a markdown code block
|
|
3
|
-
* @param text Response text that may contain markdown
|
|
4
|
-
* @returns The TypeScript code if found, undefined otherwise
|
|
5
|
-
*/
|
|
6
|
-
export declare function extractTypeScriptCode(text: string): string | undefined;
|
|
7
|
-
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/typescript/extract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGtE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts TypeScript code from a markdown code block
|
|
3
|
-
* @param text Response text that may contain markdown
|
|
4
|
-
* @returns The TypeScript code if found, undefined otherwise
|
|
5
|
-
*/
|
|
6
|
-
export function extractTypeScriptCode(text) {
|
|
7
|
-
const matches = text.match(/```(?:ts|typescript)\n([\s\S]*?)```/);
|
|
8
|
-
return matches?.[1]?.trim();
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=extract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/typescript/extract.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAClE,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/lib/typescript/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const installDependencies: import("ai").Tool<z.ZodObject<{
|
|
3
|
-
packages: z.ZodArray<z.ZodString, "many">;
|
|
4
|
-
type: z.ZodOptional<z.ZodEnum<["runtime", "dev", "peer"]>>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
packages: string[];
|
|
7
|
-
type?: "dev" | "runtime" | "peer" | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
packages: string[];
|
|
10
|
-
type?: "dev" | "runtime" | "peer" | undefined;
|
|
11
|
-
}>, {
|
|
12
|
-
success: boolean;
|
|
13
|
-
command: string;
|
|
14
|
-
output: string;
|
|
15
|
-
packages: string[];
|
|
16
|
-
type: "dev" | "runtime" | "peer" | undefined;
|
|
17
|
-
}> & {
|
|
18
|
-
execute: (args: {
|
|
19
|
-
packages: string[];
|
|
20
|
-
type?: "dev" | "runtime" | "peer" | undefined;
|
|
21
|
-
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
22
|
-
success: boolean;
|
|
23
|
-
command: string;
|
|
24
|
-
output: string;
|
|
25
|
-
packages: string[];
|
|
26
|
-
type: "dev" | "runtime" | "peer" | undefined;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=install-dependencies.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-dependencies.d.ts","sourceRoot":"","sources":["../../src/typescript/install-dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD9B,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { tool } from "ai";
|
|
2
|
-
import { exec } from "child_process";
|
|
3
|
-
import { promisify } from "util";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
const execAsync = promisify(exec);
|
|
6
|
-
export const installDependencies = tool({
|
|
7
|
-
description: "Installs dependencies using bun with support for different dependency types (runtime, dev, or peer)",
|
|
8
|
-
parameters: z.object({
|
|
9
|
-
packages: z.array(z.string()).describe("Array of package names to install"),
|
|
10
|
-
type: z
|
|
11
|
-
.enum(["runtime", "dev", "peer"])
|
|
12
|
-
.optional()
|
|
13
|
-
.describe("Type of dependency to install: runtime, dev, or peer. Default 'runtime'."),
|
|
14
|
-
}),
|
|
15
|
-
execute: async ({ packages, type }) => {
|
|
16
|
-
if (packages.length === 0) {
|
|
17
|
-
throw new Error("No packages specified for installation");
|
|
18
|
-
}
|
|
19
|
-
let command = "bun add";
|
|
20
|
-
// Add appropriate flags based on dependency type
|
|
21
|
-
switch (type) {
|
|
22
|
-
case "dev":
|
|
23
|
-
command += " -D";
|
|
24
|
-
break;
|
|
25
|
-
case "peer":
|
|
26
|
-
command += " --peer";
|
|
27
|
-
break;
|
|
28
|
-
// runtime dependencies don't need a special flag
|
|
29
|
-
}
|
|
30
|
-
// Add packages to the command
|
|
31
|
-
command += " " + packages.join(" ");
|
|
32
|
-
try {
|
|
33
|
-
console.log(`Executing: ${command}`);
|
|
34
|
-
const { stdout, stderr } = await execAsync(command);
|
|
35
|
-
if (stderr) {
|
|
36
|
-
console.warn("Installation warnings:", stderr);
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
success: true,
|
|
40
|
-
command,
|
|
41
|
-
output: stdout,
|
|
42
|
-
packages,
|
|
43
|
-
type,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
console.error("Installation failed:", error);
|
|
48
|
-
throw new Error(`Failed to install packages: ${error.message}`);
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=install-dependencies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-dependencies.js","sourceRoot":"","sources":["../../src/typescript/install-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CA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C;gBACX,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;YACjD,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO;gBACP,MAAM,EAAE,MAAM;gBACd,QAAQ;gBACR,IAAI;aACL,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const PackageJsonSchema: z.ZodObject<{
|
|
3
|
-
name: z.ZodString;
|
|
4
|
-
version: z.ZodString;
|
|
5
|
-
description: z.ZodOptional<z.ZodString>;
|
|
6
|
-
main: z.ZodOptional<z.ZodString>;
|
|
7
|
-
types: z.ZodOptional<z.ZodString>;
|
|
8
|
-
type: z.ZodLiteral<"module">;
|
|
9
|
-
scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
|
-
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
-
peerDependenciesMeta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
12
|
-
optional: z.ZodBoolean;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
optional: boolean;
|
|
15
|
-
}, {
|
|
16
|
-
optional: boolean;
|
|
17
|
-
}>>>;
|
|
18
|
-
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
19
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
20
|
-
author: z.ZodOptional<z.ZodString>;
|
|
21
|
-
license: z.ZodOptional<z.ZodString>;
|
|
22
|
-
repository: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
type: z.ZodString;
|
|
24
|
-
url: z.ZodString;
|
|
25
|
-
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
type: string;
|
|
27
|
-
url: string;
|
|
28
|
-
}, {
|
|
29
|
-
type: string;
|
|
30
|
-
url: string;
|
|
31
|
-
}>>;
|
|
32
|
-
exports: z.ZodOptional<z.ZodUnknown>;
|
|
33
|
-
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
type: "module";
|
|
36
|
-
name: string;
|
|
37
|
-
version: string;
|
|
38
|
-
description?: string | undefined;
|
|
39
|
-
main?: string | undefined;
|
|
40
|
-
types?: string | undefined;
|
|
41
|
-
scripts?: Record<string, string> | undefined;
|
|
42
|
-
peerDependencies?: Record<string, string> | undefined;
|
|
43
|
-
peerDependenciesMeta?: Record<string, {
|
|
44
|
-
optional: boolean;
|
|
45
|
-
}> | undefined;
|
|
46
|
-
devDependencies?: Record<string, string> | undefined;
|
|
47
|
-
keywords?: string[] | undefined;
|
|
48
|
-
author?: string | undefined;
|
|
49
|
-
license?: string | undefined;
|
|
50
|
-
repository?: {
|
|
51
|
-
type: string;
|
|
52
|
-
url: string;
|
|
53
|
-
} | undefined;
|
|
54
|
-
exports?: unknown;
|
|
55
|
-
files?: string[] | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
type: "module";
|
|
58
|
-
name: string;
|
|
59
|
-
version: string;
|
|
60
|
-
description?: string | undefined;
|
|
61
|
-
main?: string | undefined;
|
|
62
|
-
types?: string | undefined;
|
|
63
|
-
scripts?: Record<string, string> | undefined;
|
|
64
|
-
peerDependencies?: Record<string, string> | undefined;
|
|
65
|
-
peerDependenciesMeta?: Record<string, {
|
|
66
|
-
optional: boolean;
|
|
67
|
-
}> | undefined;
|
|
68
|
-
devDependencies?: Record<string, string> | undefined;
|
|
69
|
-
keywords?: string[] | undefined;
|
|
70
|
-
author?: string | undefined;
|
|
71
|
-
license?: string | undefined;
|
|
72
|
-
repository?: {
|
|
73
|
-
type: string;
|
|
74
|
-
url: string;
|
|
75
|
-
} | undefined;
|
|
76
|
-
exports?: unknown;
|
|
77
|
-
files?: string[] | undefined;
|
|
78
|
-
}>;
|
|
79
|
-
export declare const PackageJsonInput: z.ZodObject<{
|
|
80
|
-
/**
|
|
81
|
-
* List of requirements for the package
|
|
82
|
-
* Can include dependencies, dev dependencies, scripts, etc.
|
|
83
|
-
*/
|
|
84
|
-
requirements: z.ZodArray<z.ZodString, "many">;
|
|
85
|
-
/**
|
|
86
|
-
* List of dependencies for the package
|
|
87
|
-
*/
|
|
88
|
-
dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
-
path: z.ZodString;
|
|
90
|
-
content: z.ZodOptional<z.ZodString>;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
path: string;
|
|
93
|
-
content?: string | undefined;
|
|
94
|
-
}, {
|
|
95
|
-
path: string;
|
|
96
|
-
content?: string | undefined;
|
|
97
|
-
}>, "many">>;
|
|
98
|
-
/**
|
|
99
|
-
* Name of the package
|
|
100
|
-
*/
|
|
101
|
-
name: z.ZodString;
|
|
102
|
-
/**
|
|
103
|
-
* The ID of the model to use for generating package configuration
|
|
104
|
-
* @default "gpt-4o"
|
|
105
|
-
*/
|
|
106
|
-
model: z.ZodOptional<z.ZodString>;
|
|
107
|
-
/**
|
|
108
|
-
* Temperature setting for model generation
|
|
109
|
-
* @default 0.3
|
|
110
|
-
*/
|
|
111
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
/**
|
|
113
|
-
* Path to the package.json file to generate
|
|
114
|
-
*/
|
|
115
|
-
path: z.ZodString;
|
|
116
|
-
}, "strip", z.ZodTypeAny, {
|
|
117
|
-
path: string;
|
|
118
|
-
requirements: string[];
|
|
119
|
-
name: string;
|
|
120
|
-
temperature?: number | undefined;
|
|
121
|
-
model?: string | undefined;
|
|
122
|
-
dependencies?: {
|
|
123
|
-
path: string;
|
|
124
|
-
content?: string | undefined;
|
|
125
|
-
}[] | undefined;
|
|
126
|
-
}, {
|
|
127
|
-
path: string;
|
|
128
|
-
requirements: string[];
|
|
129
|
-
name: string;
|
|
130
|
-
temperature?: number | undefined;
|
|
131
|
-
model?: string | undefined;
|
|
132
|
-
dependencies?: {
|
|
133
|
-
path: string;
|
|
134
|
-
content?: string | undefined;
|
|
135
|
-
}[] | undefined;
|
|
136
|
-
}>;
|
|
137
|
-
export type PackageJsonInput = z.infer<typeof PackageJsonInput>;
|
|
138
|
-
export interface PackageJsonOutput {
|
|
139
|
-
path: string;
|
|
140
|
-
content: string;
|
|
141
|
-
packageJson: z.infer<typeof PackageJsonSchema>;
|
|
142
|
-
}
|
|
143
|
-
declare const PackageJson_base: import("../resource").Provider<"code::Package", [props: {
|
|
144
|
-
path: string;
|
|
145
|
-
requirements: string[];
|
|
146
|
-
name: string;
|
|
147
|
-
temperature?: number | undefined;
|
|
148
|
-
model?: string | undefined;
|
|
149
|
-
dependencies?: {
|
|
150
|
-
path: string;
|
|
151
|
-
content?: string | undefined;
|
|
152
|
-
}[] | undefined;
|
|
153
|
-
}], PackageJsonOutput>;
|
|
154
|
-
export declare class PackageJson extends PackageJson_base {
|
|
155
|
-
}
|
|
156
|
-
export {};
|
|
157
|
-
//# sourceMappingURL=package.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/typescript/package.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;IAC3B;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAChD;;;;;;;;;;;;AAED,qBAAa,WAAY,SAAQ,gBA+DhC;CAAG"}
|