create-windy 0.6.0 → 0.6.2
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 +142 -37
- package/package.json +1 -1
- package/template/.windy-template.json +2 -2
- package/template/_bunfig.toml +5 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/app.py +27 -20
- package/template/apps/embedding-server/src/southwind_embedding_server/config.py +111 -4
- package/template/apps/embedding-server/src/southwind_embedding_server/contracts.py +13 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/pin_cli.py +62 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/readiness.py +259 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/readiness_contracts.py +221 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/readiness_http.py +91 -0
- package/template/apps/embedding-server/src/southwind_embedding_server/run_service.py +23 -3
- package/template/apps/embedding-server/tests/test_config.py +13 -0
- package/template/apps/embedding-server/tests/test_readiness.py +202 -0
- package/template/apps/embedding-server/tests/test_run_http.py +76 -4
- package/template/apps/embedding-server/tests/test_run_service.py +3 -1
- package/template/apps/server/Dockerfile +10 -5
- package/template/apps/server/src/agent/drizzle-screenshot-intake-repository.integration.test.ts +3 -0
- package/template/apps/server/src/agent/run-facade.ts +2 -1
- package/template/apps/server/src/agent/run-route-screenshot-context.test.ts +13 -0
- package/template/apps/server/src/agent/runtime-bootstrap.ts +2 -0
- package/template/apps/server/src/agent/screenshot-context-admission.test.ts +249 -0
- package/template/apps/server/src/agent/screenshot-context-attestation.ts +60 -0
- package/template/apps/server/src/agent/screenshot-intake-bootstrap.ts +2 -4
- package/template/apps/server/src/agent/screenshot-intake-test-support.ts +4 -0
- package/template/apps/server/src/agent/screenshot-intake-v2-validation.ts +24 -0
- package/template/apps/server/src/agent/screenshot-intake-v2.test.ts +7 -0
- package/template/apps/server/src/agent/screenshot-intake-v2.ts +8 -10
- package/template/apps/server/src/agent/screenshot-run-binding.ts +17 -2
- package/template/apps/server/src/agent/vision-readiness-pin.ts +6 -48
- package/template/apps/server/src/ai-runtime-readiness/deployment-pin.ts +69 -0
- package/template/apps/server/src/embedding/contracts.ts +6 -1
- package/template/apps/server/src/embedding/facade-readiness.test.ts +307 -0
- package/template/apps/server/src/embedding/facade.ts +8 -6
- package/template/apps/server/src/embedding/readiness-admission.ts +26 -0
- package/template/apps/server/src/embedding/remote-runtime.test.ts +85 -0
- package/template/apps/server/src/embedding/remote-runtime.ts +21 -0
- package/template/apps/server/src/embedding/run-fingerprint.test.ts +26 -0
- package/template/apps/server/src/embedding/run-fingerprint.ts +11 -2
- package/template/apps/server/src/module-host/ai-operation-port.test.ts +72 -0
- package/template/apps/server/src/module-host/ai-operation-port.ts +43 -0
- package/template/apps/server/src/module-host/ai-operation-speech-normalize.test.ts +186 -0
- package/template/apps/web/Dockerfile +1 -1
- package/template/docker-compose.yml +11 -0
- package/template/docs/architecture/ai-runtime-readiness.md +6 -0
- package/template/docs/platform/vision-ai-runtime.md +22 -1
- package/template/package.json +2 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/database/package.json +1 -1
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/modules/index.ts +1 -0
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/ai-operation-composition.ts +2 -0
- package/template/packages/modules/src/ai-screenshot-context.test.ts +72 -0
- package/template/packages/modules/src/ai-screenshot-context.ts +50 -0
- package/template/packages/modules/src/manifest.ts +8 -0
- package/template/packages/server-sdk/package.json +1 -1
- package/template/packages/shared/index.ts +3 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/screenshot-context-digest.test.ts +46 -0
- package/template/packages/shared/src/screenshot-context-digest.ts +72 -0
package/dist/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
33
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
34
|
var __require = import.meta.require;
|
|
35
35
|
|
|
36
|
-
// ../../node_modules
|
|
36
|
+
// ../../node_modules/cli-width/index.js
|
|
37
37
|
var require_cli_width = __commonJS((exports, module2) => {
|
|
38
38
|
module2.exports = cliWidth;
|
|
39
39
|
function normalizeOpts(options) {
|
|
@@ -73,7 +73,7 @@ var require_cli_width = __commonJS((exports, module2) => {
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
// ../../node_modules
|
|
76
|
+
// ../../node_modules/mute-stream/lib/index.js
|
|
77
77
|
var require_lib = __commonJS((exports, module2) => {
|
|
78
78
|
var Stream = __require("stream");
|
|
79
79
|
|
|
@@ -378,7 +378,9 @@ var optionalModuleManifests = [
|
|
|
378
378
|
"packages/modules/src/system-agent-tools.ts",
|
|
379
379
|
"packages/database/src/agent-runtime-schema.test.ts",
|
|
380
380
|
"packages/database/src/ai-output-artifacts.test.ts",
|
|
381
|
-
"packages/shared/src/ai-runtime-report.ts"
|
|
381
|
+
"packages/shared/src/ai-runtime-report.ts",
|
|
382
|
+
"packages/shared/src/screenshot-context-digest.ts",
|
|
383
|
+
"packages/shared/src/screenshot-context-digest.test.ts"
|
|
382
384
|
],
|
|
383
385
|
documentation: [
|
|
384
386
|
"docs/architecture/ai-runtime.md",
|
|
@@ -3092,6 +3094,9 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
3092
3094
|
EMBEDDING_ADAPTER_URL: \${EMBEDDING_ADAPTER_URL:-}
|
|
3093
3095
|
EMBEDDING_ADAPTER_TOKEN: \${EMBEDDING_ADAPTER_TOKEN:-}
|
|
3094
3096
|
EMBEDDING_DEPLOYMENT_KEY: \${EMBEDDING_DEPLOYMENT_KEY:-}
|
|
3097
|
+
EMBEDDING_DEPLOYMENT_IDENTITY: \${EMBEDDING_DEPLOYMENT_IDENTITY:-}
|
|
3098
|
+
EMBEDDING_RELEASE_DIGEST: \${EMBEDDING_RELEASE_DIGEST:-}
|
|
3099
|
+
EMBEDDING_OFFERS_DIGEST: \${EMBEDDING_OFFERS_DIGEST:-}
|
|
3095
3100
|
EMBEDDING_DEPLOYMENT_ALIAS: \${EMBEDDING_DEPLOYMENT_ALIAS:-}
|
|
3096
3101
|
EMBEDDING_MODEL: \${EMBEDDING_MODEL:-}
|
|
3097
3102
|
EMBEDDING_MODEL_VERSION: \${EMBEDDING_MODEL_VERSION:-}
|
|
@@ -3099,8 +3104,16 @@ var agentComposeService = ` tool-sandbox-init:
|
|
|
3099
3104
|
EMBEDDING_NORMALIZED: \${EMBEDDING_NORMALIZED:-true}
|
|
3100
3105
|
EMBEDDING_CAPABILITIES: \${EMBEDDING_CAPABILITIES:-embedding.text}
|
|
3101
3106
|
EMBEDDING_MAX_UNITS: \${EMBEDDING_MAX_UNITS:-256}
|
|
3107
|
+
EMBEDDING_MAX_DURATION_SECONDS: \${EMBEDDING_MAX_DURATION_SECONDS:-600}
|
|
3108
|
+
EMBEDDING_MAX_INPUT_BYTES: \${EMBEDDING_MAX_INPUT_BYTES:-268435456}
|
|
3109
|
+
EMBEDDING_MAX_OUTPUT_BYTES: \${EMBEDDING_MAX_OUTPUT_BYTES:-268435456}
|
|
3110
|
+
EMBEDDING_MAX_ARTIFACTS: \${EMBEDDING_MAX_ARTIFACTS:-16}
|
|
3111
|
+
EMBEDDING_MAX_PIXELS_PER_ARTIFACT: \${EMBEDDING_MAX_PIXELS_PER_ARTIFACT:-100000000}
|
|
3102
3112
|
EMBEDDING_RUN_ENCRYPTION_SECRET: \${EMBEDDING_RUN_ENCRYPTION_SECRET:-}
|
|
3103
3113
|
EMBEDDING_MAX_CONCURRENT_RUNS: \${EMBEDDING_MAX_CONCURRENT_RUNS:-1}
|
|
3114
|
+
EMBEDDING_MAX_QUEUE_DEPTH: \${EMBEDDING_MAX_QUEUE_DEPTH:-0}
|
|
3115
|
+
EMBEDDING_READINESS_TIMEOUT_SECONDS: \${EMBEDDING_READINESS_TIMEOUT_SECONDS:-5}
|
|
3116
|
+
EMBEDDING_READINESS_TTL_SECONDS: \${EMBEDDING_READINESS_TTL_SECONDS:-60}
|
|
3104
3117
|
EMBEDDING_RUN_TERMINAL_TTL_SECONDS: \${EMBEDDING_RUN_TERMINAL_TTL_SECONDS:-604800}
|
|
3105
3118
|
volumes:
|
|
3106
3119
|
- embedding-run-data:/app/data/embedding
|
|
@@ -3190,6 +3203,9 @@ EMBEDDING_RUN_ARTIFACT_URL=
|
|
|
3190
3203
|
EMBEDDING_ADAPTER_URL=
|
|
3191
3204
|
EMBEDDING_ADAPTER_TOKEN=
|
|
3192
3205
|
EMBEDDING_DEPLOYMENT_KEY=
|
|
3206
|
+
EMBEDDING_DEPLOYMENT_IDENTITY=
|
|
3207
|
+
EMBEDDING_RELEASE_DIGEST=
|
|
3208
|
+
EMBEDDING_OFFERS_DIGEST=
|
|
3193
3209
|
EMBEDDING_DEPLOYMENT_ALIAS=
|
|
3194
3210
|
EMBEDDING_MODEL=
|
|
3195
3211
|
EMBEDDING_MODEL_VERSION=
|
|
@@ -3197,8 +3213,16 @@ EMBEDDING_DIMENSIONS=
|
|
|
3197
3213
|
# EMBEDDING_NORMALIZED=true
|
|
3198
3214
|
# EMBEDDING_CAPABILITIES=embedding.text,embedding.image
|
|
3199
3215
|
# EMBEDDING_MAX_UNITS=256
|
|
3216
|
+
# EMBEDDING_MAX_DURATION_SECONDS=600
|
|
3217
|
+
# EMBEDDING_MAX_INPUT_BYTES=268435456
|
|
3218
|
+
# EMBEDDING_MAX_OUTPUT_BYTES=268435456
|
|
3219
|
+
# EMBEDDING_MAX_ARTIFACTS=16
|
|
3220
|
+
# EMBEDDING_MAX_PIXELS_PER_ARTIFACT=100000000
|
|
3200
3221
|
EMBEDDING_RUN_ENCRYPTION_SECRET=
|
|
3201
3222
|
# EMBEDDING_MAX_CONCURRENT_RUNS=1
|
|
3223
|
+
# EMBEDDING_MAX_QUEUE_DEPTH=0
|
|
3224
|
+
# EMBEDDING_READINESS_TIMEOUT_SECONDS=5
|
|
3225
|
+
# EMBEDDING_READINESS_TTL_SECONDS=60
|
|
3202
3226
|
# EMBEDDING_RUN_TERMINAL_TTL_SECONDS=604800
|
|
3203
3227
|
QWEN_API_URL=
|
|
3204
3228
|
QWEN_API_KEY=
|
|
@@ -3530,6 +3554,10 @@ var defaultLintStaged = {
|
|
|
3530
3554
|
"*.{css,html,json,jsonc,less,md,mdx,scss,yaml,yml}": "oxfmt --write",
|
|
3531
3555
|
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": ["oxfmt --write", "oxlint"]
|
|
3532
3556
|
};
|
|
3557
|
+
var migrationCliDependencies = {
|
|
3558
|
+
"drizzle-orm": "^0.45.2",
|
|
3559
|
+
pg: "^8.22.0"
|
|
3560
|
+
};
|
|
3533
3561
|
function createStarterPackage(source, projectName, includeOxc = true, projectLicense = "UNLICENSED", selectedModules = [], generatorVersion) {
|
|
3534
3562
|
const { "lint-staged": sourceLintStaged, ...sourceWithoutLintStaged } = source;
|
|
3535
3563
|
const devDependencies = { ...source.devDependencies };
|
|
@@ -3589,6 +3617,7 @@ function createStarterPackage(source, projectName, includeOxc = true, projectLic
|
|
|
3589
3617
|
test: "bun test && bun run --cwd apps/web test"
|
|
3590
3618
|
},
|
|
3591
3619
|
devDependencies: {
|
|
3620
|
+
...migrationCliDependencies,
|
|
3592
3621
|
...devDependencies,
|
|
3593
3622
|
...generatorVersion ? { "create-windy": generatorVersion } : {}
|
|
3594
3623
|
}
|
|
@@ -4200,7 +4229,7 @@ function isMissing6(error) {
|
|
|
4200
4229
|
import { createInterface as createInterface2 } from "readline/promises";
|
|
4201
4230
|
import { stdin, stdout } from "process";
|
|
4202
4231
|
|
|
4203
|
-
// ../../node_modules
|
|
4232
|
+
// ../../node_modules/@inquirer/core/dist/lib/key.js
|
|
4204
4233
|
var keybindings = ["emacs", "vim"];
|
|
4205
4234
|
var keybindingLookup = new Set(keybindings);
|
|
4206
4235
|
function isKeybinding(value) {
|
|
@@ -4217,7 +4246,7 @@ var isDownKey = (key, keybindings2 = []) => key.name === "down" || keybindings2.
|
|
|
4217
4246
|
var isSpaceKey = (key) => key.name === "space";
|
|
4218
4247
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
4219
4248
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
4220
|
-
// ../../node_modules
|
|
4249
|
+
// ../../node_modules/@inquirer/core/dist/lib/errors.js
|
|
4221
4250
|
class AbortPromptError extends Error {
|
|
4222
4251
|
name = "AbortPromptError";
|
|
4223
4252
|
message = "Prompt was aborted";
|
|
@@ -4243,10 +4272,10 @@ class HookError extends Error {
|
|
|
4243
4272
|
class ValidationError extends Error {
|
|
4244
4273
|
name = "ValidationError";
|
|
4245
4274
|
}
|
|
4246
|
-
// ../../node_modules
|
|
4275
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-state.js
|
|
4247
4276
|
import { AsyncResource as AsyncResource2 } from "async_hooks";
|
|
4248
4277
|
|
|
4249
|
-
// ../../node_modules
|
|
4278
|
+
// ../../node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
4250
4279
|
import { AsyncLocalStorage, AsyncResource } from "async_hooks";
|
|
4251
4280
|
var hookStorage = new AsyncLocalStorage;
|
|
4252
4281
|
function createStore(rl) {
|
|
@@ -4351,7 +4380,7 @@ var effectScheduler = {
|
|
|
4351
4380
|
}
|
|
4352
4381
|
};
|
|
4353
4382
|
|
|
4354
|
-
// ../../node_modules
|
|
4383
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-state.js
|
|
4355
4384
|
function isFactory(value) {
|
|
4356
4385
|
return typeof value === "function";
|
|
4357
4386
|
}
|
|
@@ -4372,7 +4401,7 @@ function useState(defaultValue) {
|
|
|
4372
4401
|
});
|
|
4373
4402
|
}
|
|
4374
4403
|
|
|
4375
|
-
// ../../node_modules
|
|
4404
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
4376
4405
|
function useEffect(cb, depArray) {
|
|
4377
4406
|
withPointer((pointer) => {
|
|
4378
4407
|
const oldDeps = pointer.get();
|
|
@@ -4384,10 +4413,10 @@ function useEffect(cb, depArray) {
|
|
|
4384
4413
|
});
|
|
4385
4414
|
}
|
|
4386
4415
|
|
|
4387
|
-
// ../../node_modules
|
|
4416
|
+
// ../../node_modules/@inquirer/core/dist/lib/theme.js
|
|
4388
4417
|
import { styleText } from "util";
|
|
4389
4418
|
|
|
4390
|
-
// ../../node_modules
|
|
4419
|
+
// ../../node_modules/@inquirer/figures/dist/index.js
|
|
4391
4420
|
import process2 from "process";
|
|
4392
4421
|
function isUnicodeSupported() {
|
|
4393
4422
|
if (!process2.platform.startsWith("win")) {
|
|
@@ -4676,7 +4705,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
4676
4705
|
var dist_default = figures;
|
|
4677
4706
|
var replacements = Object.entries(specialMainSymbols);
|
|
4678
4707
|
|
|
4679
|
-
// ../../node_modules
|
|
4708
|
+
// ../../node_modules/@inquirer/core/dist/lib/theme.js
|
|
4680
4709
|
var defaultTheme = {
|
|
4681
4710
|
prefix: {
|
|
4682
4711
|
idle: styleText("blue", "?"),
|
|
@@ -4704,7 +4733,7 @@ function getDefaultTheme() {
|
|
|
4704
4733
|
};
|
|
4705
4734
|
}
|
|
4706
4735
|
|
|
4707
|
-
// ../../node_modules
|
|
4736
|
+
// ../../node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
4708
4737
|
function isPlainObject(value) {
|
|
4709
4738
|
if (typeof value !== "object" || value === null)
|
|
4710
4739
|
return false;
|
|
@@ -4732,7 +4761,7 @@ function makeTheme(...themes) {
|
|
|
4732
4761
|
return deepMerge(...themesToMerge);
|
|
4733
4762
|
}
|
|
4734
4763
|
|
|
4735
|
-
// ../../node_modules
|
|
4764
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
4736
4765
|
function usePrefix({ status = "idle", theme }) {
|
|
4737
4766
|
const [showLoader, setShowLoader] = useState(false);
|
|
4738
4767
|
const [tick, setTick] = useState(0);
|
|
@@ -4762,7 +4791,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
4762
4791
|
const iconName = status === "loading" ? "idle" : status;
|
|
4763
4792
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
4764
4793
|
}
|
|
4765
|
-
// ../../node_modules
|
|
4794
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
4766
4795
|
function useMemo(fn, dependencies) {
|
|
4767
4796
|
return withPointer((pointer) => {
|
|
4768
4797
|
const prev = pointer.get();
|
|
@@ -4774,12 +4803,12 @@ function useMemo(fn, dependencies) {
|
|
|
4774
4803
|
return prev.value;
|
|
4775
4804
|
});
|
|
4776
4805
|
}
|
|
4777
|
-
// ../../node_modules
|
|
4806
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
4778
4807
|
function useRef(val) {
|
|
4779
4808
|
return useState({ current: val })[0];
|
|
4780
4809
|
}
|
|
4781
4810
|
|
|
4782
|
-
// ../../node_modules
|
|
4811
|
+
// ../../node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
4783
4812
|
function useKeypress(userHandler) {
|
|
4784
4813
|
const signal = useRef(userHandler);
|
|
4785
4814
|
signal.current = userHandler;
|
|
@@ -4797,10 +4826,10 @@ function useKeypress(userHandler) {
|
|
|
4797
4826
|
};
|
|
4798
4827
|
}, []);
|
|
4799
4828
|
}
|
|
4800
|
-
// ../../node_modules
|
|
4829
|
+
// ../../node_modules/@inquirer/core/dist/lib/utils.js
|
|
4801
4830
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
4802
4831
|
|
|
4803
|
-
// ../../node_modules
|
|
4832
|
+
// ../../node_modules/fast-string-truncated-width/dist/utils.js
|
|
4804
4833
|
var getCodePointsLength = (() => {
|
|
4805
4834
|
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
4806
4835
|
return (input) => {
|
|
@@ -4819,7 +4848,7 @@ var isWideNotCJKTNotEmoji = (x) => {
|
|
|
4819
4848
|
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
4820
4849
|
};
|
|
4821
4850
|
|
|
4822
|
-
// ../../node_modules
|
|
4851
|
+
// ../../node_modules/fast-string-truncated-width/dist/index.js
|
|
4823
4852
|
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
4824
4853
|
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
4825
4854
|
var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
@@ -4918,7 +4947,7 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
|
|
|
4918
4947
|
};
|
|
4919
4948
|
var dist_default2 = getStringTruncatedWidth;
|
|
4920
4949
|
|
|
4921
|
-
// ../../node_modules
|
|
4950
|
+
// ../../node_modules/fast-string-width/dist/index.js
|
|
4922
4951
|
var NO_TRUNCATION2 = {
|
|
4923
4952
|
limit: Infinity,
|
|
4924
4953
|
ellipsis: "",
|
|
@@ -4929,7 +4958,7 @@ var fastStringWidth = (input, options = {}) => {
|
|
|
4929
4958
|
};
|
|
4930
4959
|
var dist_default3 = fastStringWidth;
|
|
4931
4960
|
|
|
4932
|
-
// ../../node_modules
|
|
4961
|
+
// ../../node_modules/fast-wrap-ansi/lib/main.js
|
|
4933
4962
|
var ESC = "\x1B";
|
|
4934
4963
|
var CSI = "\x9B";
|
|
4935
4964
|
var END_CODE = 39;
|
|
@@ -5141,7 +5170,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
5141
5170
|
`);
|
|
5142
5171
|
}
|
|
5143
5172
|
|
|
5144
|
-
// ../../node_modules
|
|
5173
|
+
// ../../node_modules/@inquirer/core/dist/lib/utils.js
|
|
5145
5174
|
function breakLines(content, width) {
|
|
5146
5175
|
return content.split(`
|
|
5147
5176
|
`).flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split(`
|
|
@@ -5152,7 +5181,7 @@ function readlineWidth() {
|
|
|
5152
5181
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
5153
5182
|
}
|
|
5154
5183
|
|
|
5155
|
-
// ../../node_modules
|
|
5184
|
+
// ../../node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
5156
5185
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
5157
5186
|
const state = useRef({
|
|
5158
5187
|
lastPointer: active,
|
|
@@ -5218,12 +5247,12 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
5218
5247
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
5219
5248
|
`);
|
|
5220
5249
|
}
|
|
5221
|
-
// ../../node_modules
|
|
5250
|
+
// ../../node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
5222
5251
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
5223
5252
|
import * as readline2 from "readline";
|
|
5224
5253
|
import { AsyncResource as AsyncResource3 } from "async_hooks";
|
|
5225
5254
|
|
|
5226
|
-
// ../../node_modules
|
|
5255
|
+
// ../../node_modules/signal-exit/dist/mjs/signals.js
|
|
5227
5256
|
var signals = [];
|
|
5228
5257
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
5229
5258
|
if (process.platform !== "win32") {
|
|
@@ -5233,7 +5262,7 @@ if (process.platform === "linux") {
|
|
|
5233
5262
|
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
5234
5263
|
}
|
|
5235
5264
|
|
|
5236
|
-
// ../../node_modules
|
|
5265
|
+
// ../../node_modules/signal-exit/dist/mjs/index.js
|
|
5237
5266
|
var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
|
|
5238
5267
|
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
5239
5268
|
var global = globalThis;
|
|
@@ -5431,10 +5460,10 @@ var {
|
|
|
5431
5460
|
unload
|
|
5432
5461
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
5433
5462
|
|
|
5434
|
-
// ../../node_modules
|
|
5463
|
+
// ../../node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
5435
5464
|
import { stripVTControlCharacters } from "util";
|
|
5436
5465
|
|
|
5437
|
-
// ../../node_modules
|
|
5466
|
+
// ../../node_modules/@inquirer/ansi/dist/index.js
|
|
5438
5467
|
var ESC2 = "\x1B[";
|
|
5439
5468
|
var cursorLeft = ESC2 + "G";
|
|
5440
5469
|
var cursorHide = ESC2 + "?25l";
|
|
@@ -5450,7 +5479,7 @@ var cursorTo = (x, y) => {
|
|
|
5450
5479
|
var eraseLine = ESC2 + "2K";
|
|
5451
5480
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
5452
5481
|
|
|
5453
|
-
// ../../node_modules
|
|
5482
|
+
// ../../node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
5454
5483
|
var height = (content) => content.split(`
|
|
5455
5484
|
`).length;
|
|
5456
5485
|
var lastLine = (content) => content.split(`
|
|
@@ -5516,7 +5545,7 @@ class ScreenManager {
|
|
|
5516
5545
|
}
|
|
5517
5546
|
}
|
|
5518
5547
|
|
|
5519
|
-
// ../../node_modules
|
|
5548
|
+
// ../../node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
5520
5549
|
class PromisePolyfill extends Promise {
|
|
5521
5550
|
static withResolver() {
|
|
5522
5551
|
let resolve6;
|
|
@@ -5529,7 +5558,7 @@ class PromisePolyfill extends Promise {
|
|
|
5529
5558
|
}
|
|
5530
5559
|
}
|
|
5531
5560
|
|
|
5532
|
-
// ../../node_modules
|
|
5561
|
+
// ../../node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
5533
5562
|
import path from "path";
|
|
5534
5563
|
var nativeSetImmediate = globalThis.setImmediate;
|
|
5535
5564
|
function getCallSites() {
|
|
@@ -5640,7 +5669,7 @@ function createPrompt(view) {
|
|
|
5640
5669
|
};
|
|
5641
5670
|
return prompt;
|
|
5642
5671
|
}
|
|
5643
|
-
// ../../node_modules
|
|
5672
|
+
// ../../node_modules/@inquirer/core/dist/lib/Separator.js
|
|
5644
5673
|
import { styleText as styleText2 } from "util";
|
|
5645
5674
|
class Separator {
|
|
5646
5675
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -5654,7 +5683,7 @@ class Separator {
|
|
|
5654
5683
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
5655
5684
|
}
|
|
5656
5685
|
}
|
|
5657
|
-
// ../../node_modules
|
|
5686
|
+
// ../../node_modules/@inquirer/checkbox/dist/index.js
|
|
5658
5687
|
import { styleText as styleText3 } from "util";
|
|
5659
5688
|
var checkboxTheme = {
|
|
5660
5689
|
icon: {
|
|
@@ -7723,6 +7752,16 @@ var recipes = [
|
|
|
7723
7752
|
id: "starter-0.5.2-to-0.6.0",
|
|
7724
7753
|
from: "0.5.2",
|
|
7725
7754
|
to: "0.6.0"
|
|
7755
|
+
},
|
|
7756
|
+
{
|
|
7757
|
+
id: "starter-0.6.0-to-0.6.1",
|
|
7758
|
+
from: "0.6.0",
|
|
7759
|
+
to: "0.6.1"
|
|
7760
|
+
},
|
|
7761
|
+
{
|
|
7762
|
+
id: "starter-0.6.1-to-0.6.2",
|
|
7763
|
+
from: "0.6.1",
|
|
7764
|
+
to: "0.6.2"
|
|
7726
7765
|
}
|
|
7727
7766
|
];
|
|
7728
7767
|
function resolveRecipeChain(sourceVersion, targetVersion) {
|
|
@@ -8774,7 +8813,7 @@ async function mergeTextFile(base, ours, theirs) {
|
|
|
8774
8813
|
}
|
|
8775
8814
|
return { content: new TextEncoder().encode(result2.stdout) };
|
|
8776
8815
|
}
|
|
8777
|
-
if (result2.code
|
|
8816
|
+
if (result2.code > 0 && result2.code <= 127) {
|
|
8778
8817
|
const resolved = resolveConservativeConflicts(result2.stdout);
|
|
8779
8818
|
return resolved ? { content: new TextEncoder().encode(resolved) } : { conflict: "\u4E09\u65B9\u5408\u5E76\u5B58\u5728\u91CD\u53E0\u4FEE\u6539" };
|
|
8780
8819
|
}
|
|
@@ -8957,6 +8996,11 @@ function mergeValue(base, ours, theirs, path2, conflicts) {
|
|
|
8957
8996
|
if (files)
|
|
8958
8997
|
return files;
|
|
8959
8998
|
}
|
|
8999
|
+
if (path2.startsWith("package.json.scripts.")) {
|
|
9000
|
+
const script = mergeConjunctionScript(base, ours, theirs);
|
|
9001
|
+
if (script !== undefined)
|
|
9002
|
+
return script;
|
|
9003
|
+
}
|
|
8960
9004
|
if (isObject(base) && isObject(ours) && isObject(theirs)) {
|
|
8961
9005
|
const output = {};
|
|
8962
9006
|
const keys = new Set([
|
|
@@ -8983,6 +9027,52 @@ function mergeAppendOnlyStringSet(base, ours, theirs) {
|
|
|
8983
9027
|
}
|
|
8984
9028
|
return [...new Set([...ours, ...theirs])].sort();
|
|
8985
9029
|
}
|
|
9030
|
+
function mergeConjunctionScript(base, ours, theirs) {
|
|
9031
|
+
if (typeof base !== "string" || typeof ours !== "string" || typeof theirs !== "string") {
|
|
9032
|
+
return;
|
|
9033
|
+
}
|
|
9034
|
+
const baseCommands = conjunctionCommands(base);
|
|
9035
|
+
const oursCommands = conjunctionCommands(ours);
|
|
9036
|
+
const theirsCommands = conjunctionCommands(theirs);
|
|
9037
|
+
if (!baseCommands || !oursCommands || !theirsCommands || !unique(baseCommands) || !unique(oursCommands) || !unique(theirsCommands)) {
|
|
9038
|
+
return;
|
|
9039
|
+
}
|
|
9040
|
+
const oursGaps = additionsByBaseGap(baseCommands, oursCommands);
|
|
9041
|
+
const theirsGaps = additionsByBaseGap(baseCommands, theirsCommands);
|
|
9042
|
+
if (!oursGaps || !theirsGaps)
|
|
9043
|
+
return;
|
|
9044
|
+
const merged = [];
|
|
9045
|
+
for (let gap = 0;gap <= baseCommands.length; gap += 1) {
|
|
9046
|
+
const oursAdded = oursGaps[gap] ?? [];
|
|
9047
|
+
const theirsAdded = theirsGaps[gap] ?? [];
|
|
9048
|
+
if (oursAdded.length && theirsAdded.length && !equal(oursAdded, theirsAdded)) {
|
|
9049
|
+
return;
|
|
9050
|
+
}
|
|
9051
|
+
merged.push(...oursAdded.length ? oursAdded : theirsAdded);
|
|
9052
|
+
if (gap < baseCommands.length)
|
|
9053
|
+
merged.push(baseCommands[gap] ?? "");
|
|
9054
|
+
}
|
|
9055
|
+
return merged.join(" && ");
|
|
9056
|
+
}
|
|
9057
|
+
function conjunctionCommands(value) {
|
|
9058
|
+
const commands = value.split(" && ");
|
|
9059
|
+
return commands.length && commands.every((command) => command.length > 0) && commands.join(" && ") === value ? commands : undefined;
|
|
9060
|
+
}
|
|
9061
|
+
function additionsByBaseGap(base, branch) {
|
|
9062
|
+
const gaps = Array.from({ length: base.length + 1 }, () => []);
|
|
9063
|
+
let baseIndex = 0;
|
|
9064
|
+
for (const command of branch) {
|
|
9065
|
+
if (command === base[baseIndex]) {
|
|
9066
|
+
baseIndex += 1;
|
|
9067
|
+
} else {
|
|
9068
|
+
gaps[baseIndex]?.push(command);
|
|
9069
|
+
}
|
|
9070
|
+
}
|
|
9071
|
+
return baseIndex === base.length ? gaps : undefined;
|
|
9072
|
+
}
|
|
9073
|
+
function unique(values) {
|
|
9074
|
+
return new Set(values).size === values.length;
|
|
9075
|
+
}
|
|
8986
9076
|
function isStringArray(value) {
|
|
8987
9077
|
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
8988
9078
|
}
|
|
@@ -10413,11 +10503,15 @@ function actionLabel(action) {
|
|
|
10413
10503
|
}
|
|
10414
10504
|
|
|
10415
10505
|
// src/update/cli.ts
|
|
10416
|
-
async function runLifecycleCommand(args) {
|
|
10506
|
+
async function runLifecycleCommand(args, dependencies = {}) {
|
|
10417
10507
|
const command = args[0];
|
|
10418
10508
|
if (command !== "doctor" && command !== "update" && command !== "module" && command !== "sync-docker") {
|
|
10419
10509
|
return false;
|
|
10420
10510
|
}
|
|
10511
|
+
if (command === "update" && (args.includes("--help") || args.includes("-h"))) {
|
|
10512
|
+
(dependencies.log || console.log)(updateHelpText);
|
|
10513
|
+
return true;
|
|
10514
|
+
}
|
|
10421
10515
|
const projectDirectory = resolve8(readValue3(args, "--cwd") || process.cwd());
|
|
10422
10516
|
if (command === "module") {
|
|
10423
10517
|
await runModuleLifecycleCommand(args.slice(1), projectDirectory);
|
|
@@ -10471,9 +10565,20 @@ async function runLifecycleCommand(args) {
|
|
|
10471
10565
|
}
|
|
10472
10566
|
return true;
|
|
10473
10567
|
}
|
|
10474
|
-
await runUpdate(args, projectDirectory);
|
|
10568
|
+
await (dependencies.runUpdate || runUpdate)(args, projectDirectory);
|
|
10475
10569
|
return true;
|
|
10476
10570
|
}
|
|
10571
|
+
var updateHelpText = `\u7528\u6CD5\uFF1Acreate-windy update [\u9009\u9879]
|
|
10572
|
+
|
|
10573
|
+
\u9009\u9879\uFF1A
|
|
10574
|
+
--check \u68C0\u67E5\u662F\u5426\u5B58\u5728\u53EF\u7528\u66F4\u65B0
|
|
10575
|
+
--dry-run \u751F\u6210\u8BA1\u5212\u4F46\u4E0D\u5199\u5165\u9879\u76EE\u6587\u4EF6
|
|
10576
|
+
--to <\u7248\u672C> \u66F4\u65B0\u5230\u6307\u5B9A\u7248\u672C
|
|
10577
|
+
--cwd <\u76EE\u5F55> \u6307\u5B9A\u9879\u76EE\u76EE\u5F55
|
|
10578
|
+
--skip-install \u66F4\u65B0\u65F6\u4E0D\u6267\u884C bun install
|
|
10579
|
+
--force \u5F3A\u5236\u91C7\u7528\u5E73\u53F0\u57FA\u7EBF\u53C2\u4E0E\u4E09\u65B9\u5408\u5E76
|
|
10580
|
+
-h, --help \u663E\u793A update \u5E2E\u52A9\u5E76\u9000\u51FA
|
|
10581
|
+
`;
|
|
10477
10582
|
async function runUpdate(args, projectDirectory) {
|
|
10478
10583
|
const template = await readTemplateMetadata(await resolveTemplateRoot());
|
|
10479
10584
|
const requested = readValue3(args, "--to");
|
package/package.json
CHANGED
package/template/_bunfig.toml
CHANGED
|
@@ -15,23 +15,33 @@ from .adapter import EmbeddingAdapter
|
|
|
15
15
|
from .config import EmbeddingConfig
|
|
16
16
|
from .contracts import EmbeddingRequest, EmbeddingResponse, ErrorResponse
|
|
17
17
|
from .error import SafeEmbeddingError
|
|
18
|
+
from .readiness import EmbeddingReadinessPort, EmbeddingReadinessProbe
|
|
18
19
|
from .run_cipher import EmbeddingRunCipher
|
|
19
|
-
from .run_service import EmbeddingRunService
|
|
20
|
+
from .run_service import EmbeddingExecutionPort, EmbeddingRunService
|
|
20
21
|
from .run_store import EmbeddingRunStore, RunConflictError
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
def create_app(
|
|
24
25
|
config: EmbeddingConfig,
|
|
25
|
-
adapter:
|
|
26
|
+
adapter: EmbeddingExecutionPort | None = None,
|
|
27
|
+
readiness_probe: EmbeddingReadinessPort | None = None,
|
|
26
28
|
) -> FastAPI:
|
|
27
29
|
app = FastAPI(title="Southwind Embedding Runtime", docs_url=None, redoc_url=None)
|
|
28
30
|
runtime = adapter or EmbeddingAdapter(config)
|
|
31
|
+
readiness = readiness_probe or EmbeddingReadinessProbe(config)
|
|
29
32
|
store = EmbeddingRunStore(
|
|
30
33
|
config.run_store_path,
|
|
31
34
|
EmbeddingRunCipher(config.run_encryption_secret),
|
|
32
35
|
config.terminal_ttl_seconds,
|
|
33
36
|
)
|
|
34
|
-
|
|
37
|
+
|
|
38
|
+
async def admit(request: EmbeddingRequest) -> bool:
|
|
39
|
+
inspection = await readiness.inspect()
|
|
40
|
+
return readiness.supports(inspection, request)
|
|
41
|
+
|
|
42
|
+
service = EmbeddingRunService(
|
|
43
|
+
runtime, store, config.max_concurrent_runs, admit=admit
|
|
44
|
+
)
|
|
35
45
|
|
|
36
46
|
@asynccontextmanager
|
|
37
47
|
async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
|
@@ -47,24 +57,9 @@ def create_app(
|
|
|
47
57
|
|
|
48
58
|
@app.get("/health/ready")
|
|
49
59
|
async def ready(_: None = Depends(authorize)) -> JSONResponse:
|
|
50
|
-
|
|
51
|
-
return JSONResponse(
|
|
52
|
-
{"status": "unavailable", "capabilities": []},
|
|
53
|
-
status_code=503,
|
|
54
|
-
)
|
|
60
|
+
inspection = await readiness.inspect()
|
|
55
61
|
return JSONResponse(
|
|
56
|
-
|
|
57
|
-
"status": "ready",
|
|
58
|
-
"capabilities": list(config.capabilities),
|
|
59
|
-
"limits": {"maxUnits": config.max_units},
|
|
60
|
-
"deployment": {
|
|
61
|
-
"alias": config.deployment_alias,
|
|
62
|
-
"model": config.model,
|
|
63
|
-
"version": config.version,
|
|
64
|
-
"dimensions": config.dimensions,
|
|
65
|
-
"normalized": config.normalized,
|
|
66
|
-
},
|
|
67
|
-
}
|
|
62
|
+
inspection.snapshot, status_code=200 if inspection.ready else 503
|
|
68
63
|
)
|
|
69
64
|
|
|
70
65
|
@app.post("/api/embeddings")
|
|
@@ -75,6 +70,12 @@ def create_app(
|
|
|
75
70
|
) -> EmbeddingResponse:
|
|
76
71
|
if not idempotency_key.strip() or len(idempotency_key) > 160:
|
|
77
72
|
raise HTTPException(status_code=400, detail="INVALID_INPUT")
|
|
73
|
+
if not await admit(request):
|
|
74
|
+
raise SafeEmbeddingError(
|
|
75
|
+
"CAPABILITY_UNAVAILABLE",
|
|
76
|
+
"Embedding Runtime 当前没有匹配的原子 offer",
|
|
77
|
+
True,
|
|
78
|
+
)
|
|
78
79
|
try:
|
|
79
80
|
async with asyncio.timeout(request.limits.max_duration_seconds):
|
|
80
81
|
return await runtime.embed(request)
|
|
@@ -98,6 +99,12 @@ def create_app(
|
|
|
98
99
|
or not valid_run_id(run_id)
|
|
99
100
|
):
|
|
100
101
|
raise HTTPException(status_code=400, detail="INVALID_INPUT")
|
|
102
|
+
if not await admit(request):
|
|
103
|
+
raise SafeEmbeddingError(
|
|
104
|
+
"CAPABILITY_UNAVAILABLE",
|
|
105
|
+
"Embedding Runtime 当前没有匹配的原子 offer",
|
|
106
|
+
True,
|
|
107
|
+
)
|
|
101
108
|
try:
|
|
102
109
|
record = await service.start(request, idempotency_key, run_id)
|
|
103
110
|
except RunConflictError:
|