toolcraft-openapi 0.0.16 → 0.0.18
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/bin/generate.js +7 -0
- package/dist/define-client.js +2 -2
- package/dist/generate.js +2 -2
- package/dist/http.d.ts +21 -2
- package/dist/http.js +147 -22
- package/dist/index.d.ts +1 -1
- package/dist/lock.d.ts +1 -1
- package/dist/lock.js +109 -5
- package/dist/mock/fetch.js +1 -1
- package/dist/network-error.d.ts +2 -0
- package/dist/network-error.js +83 -0
- package/dist/spec-source.js +103 -3
- package/node_modules/@poe-code/design-system/dist/components/help-formatter-plain.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/components/help-formatter-plain.js +1 -1
- package/node_modules/@poe-code/design-system/dist/components/text.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/components/text.js +8 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/buffer.js +8 -1
- package/node_modules/@poe-code/design-system/dist/dashboard/keymap.d.ts +5 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/keymap.js +146 -12
- package/node_modules/@poe-code/design-system/dist/dashboard/terminal.js +31 -0
- package/node_modules/@poe-code/design-system/dist/dashboard/types.d.ts +1 -0
- package/node_modules/@poe-code/design-system/dist/explorer/actions.d.ts +16 -0
- package/node_modules/@poe-code/design-system/dist/explorer/actions.js +39 -0
- package/node_modules/@poe-code/design-system/dist/explorer/demo.d.ts +13 -0
- package/node_modules/@poe-code/design-system/dist/explorer/demo.js +297 -0
- package/node_modules/@poe-code/design-system/dist/explorer/events.d.ts +61 -0
- package/node_modules/@poe-code/design-system/dist/explorer/events.js +1 -0
- package/node_modules/@poe-code/design-system/dist/explorer/filter.d.ts +10 -0
- package/node_modules/@poe-code/design-system/dist/explorer/filter.js +95 -0
- package/node_modules/@poe-code/design-system/dist/explorer/index.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/explorer/index.js +8 -0
- package/node_modules/@poe-code/design-system/dist/explorer/jobs.d.ts +7 -0
- package/node_modules/@poe-code/design-system/dist/explorer/jobs.js +59 -0
- package/node_modules/@poe-code/design-system/dist/explorer/keymap.d.ts +21 -0
- package/node_modules/@poe-code/design-system/dist/explorer/keymap.js +363 -0
- package/node_modules/@poe-code/design-system/dist/explorer/layout.d.ts +20 -0
- package/node_modules/@poe-code/design-system/dist/explorer/layout.js +73 -0
- package/node_modules/@poe-code/design-system/dist/explorer/reducer.d.ts +9 -0
- package/node_modules/@poe-code/design-system/dist/explorer/reducer.js +704 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/detail.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/detail.js +96 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/footer.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/footer.js +49 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/header.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/header.js +56 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/index.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/index.js +61 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/list.d.ts +4 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/list.js +106 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/modal.d.ts +3 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/modal.js +91 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/test-fixtures.d.ts +8 -0
- package/node_modules/@poe-code/design-system/dist/explorer/render/test-fixtures.js +156 -0
- package/node_modules/@poe-code/design-system/dist/explorer/runtime.d.ts +2 -0
- package/node_modules/@poe-code/design-system/dist/explorer/runtime.js +282 -0
- package/node_modules/@poe-code/design-system/dist/explorer/runtime.test-helpers.d.ts +50 -0
- package/node_modules/@poe-code/design-system/dist/explorer/runtime.test-helpers.js +101 -0
- package/node_modules/@poe-code/design-system/dist/explorer/state.d.ts +130 -0
- package/node_modules/@poe-code/design-system/dist/explorer/state.js +87 -0
- package/node_modules/@poe-code/design-system/dist/explorer/theme.d.ts +27 -0
- package/node_modules/@poe-code/design-system/dist/explorer/theme.js +97 -0
- package/node_modules/@poe-code/design-system/dist/index.d.ts +3 -0
- package/node_modules/@poe-code/design-system/dist/index.js +3 -0
- package/node_modules/@poe-code/design-system/package.json +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export function getExplorerTheme() {
|
|
2
|
+
return {
|
|
3
|
+
accent: accent,
|
|
4
|
+
muted: muted,
|
|
5
|
+
border: muted,
|
|
6
|
+
borderFocused: accent,
|
|
7
|
+
badge: (text, tone) => tonePainter(tone)(` ${text} `),
|
|
8
|
+
matchHighlight: (text) => accent(`\u001b[4m${text}\u001b[24m`)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function getExplorerStyles() {
|
|
12
|
+
return resolveThemeName() === "light"
|
|
13
|
+
? {
|
|
14
|
+
accent: { fg: "#006699", bold: true },
|
|
15
|
+
muted: { fg: "#666666" },
|
|
16
|
+
border: { fg: "#666666" },
|
|
17
|
+
borderFocused: { fg: "#006699", bold: true },
|
|
18
|
+
matchHighlight: { fg: "#006699", bold: true, underline: true },
|
|
19
|
+
tones: {
|
|
20
|
+
success: { fg: "#008800" },
|
|
21
|
+
warning: { fg: "#cc6600" },
|
|
22
|
+
error: { fg: "#cc0000" },
|
|
23
|
+
info: { fg: "#a200ff" },
|
|
24
|
+
muted: { fg: "#666666" }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
accent: { fg: "cyan", bold: true },
|
|
29
|
+
muted: { dim: true },
|
|
30
|
+
border: { dim: true },
|
|
31
|
+
borderFocused: { fg: "cyan", bold: true },
|
|
32
|
+
matchHighlight: { fg: "cyan", bold: true, underline: true },
|
|
33
|
+
tones: {
|
|
34
|
+
success: { fg: "green" },
|
|
35
|
+
warning: { fg: "yellow" },
|
|
36
|
+
error: { fg: "red" },
|
|
37
|
+
info: { fg: "magenta" },
|
|
38
|
+
muted: { dim: true }
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function tonePainter(tone) {
|
|
43
|
+
const light = resolveThemeName() === "light";
|
|
44
|
+
if (tone === "success") {
|
|
45
|
+
return light ? hex(0, 136, 0) : ansi(32);
|
|
46
|
+
}
|
|
47
|
+
if (tone === "warning") {
|
|
48
|
+
return light ? hex(204, 102, 0) : ansi(33);
|
|
49
|
+
}
|
|
50
|
+
if (tone === "error") {
|
|
51
|
+
return light ? hex(204, 0, 0) : ansi(31);
|
|
52
|
+
}
|
|
53
|
+
if (tone === "info") {
|
|
54
|
+
return light ? hex(162, 0, 255) : ansi(35);
|
|
55
|
+
}
|
|
56
|
+
return muted;
|
|
57
|
+
}
|
|
58
|
+
function accent(text) {
|
|
59
|
+
return resolveThemeName() === "light" ? ansi(38, 2, 0, 102, 153, 1)(text) : ansi(36)(text);
|
|
60
|
+
}
|
|
61
|
+
function muted(text) {
|
|
62
|
+
return resolveThemeName() === "light" ? hex(102, 102, 102)(text) : ansi(2)(text);
|
|
63
|
+
}
|
|
64
|
+
function hex(red, green, blue) {
|
|
65
|
+
return ansi(38, 2, red, green, blue);
|
|
66
|
+
}
|
|
67
|
+
function ansi(...codes) {
|
|
68
|
+
return (text) => `\u001b[${codes.join(";")}m${text}\u001b[0m`;
|
|
69
|
+
}
|
|
70
|
+
function resolveThemeName(env = process.env) {
|
|
71
|
+
const raw = (env.POE_CODE_THEME ?? env.POE_THEME)?.toLowerCase();
|
|
72
|
+
if (raw === "light" || raw === "dark") {
|
|
73
|
+
return raw;
|
|
74
|
+
}
|
|
75
|
+
const apple = env.APPLE_INTERFACE_STYLE;
|
|
76
|
+
if (typeof apple === "string") {
|
|
77
|
+
return apple.toLowerCase() === "dark" ? "dark" : "light";
|
|
78
|
+
}
|
|
79
|
+
const vscodeKind = env.VSCODE_COLOR_THEME_KIND;
|
|
80
|
+
if (typeof vscodeKind === "string") {
|
|
81
|
+
const normalized = vscodeKind.toLowerCase();
|
|
82
|
+
if (normalized.includes("light")) {
|
|
83
|
+
return "light";
|
|
84
|
+
}
|
|
85
|
+
if (normalized.includes("dark")) {
|
|
86
|
+
return "dark";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const colorFGBG = env.COLORFGBG;
|
|
90
|
+
if (typeof colorFGBG === "string") {
|
|
91
|
+
const background = Number.parseInt(colorFGBG.split(";").at(-1) ?? "", 10);
|
|
92
|
+
if (Number.isFinite(background)) {
|
|
93
|
+
return background >= 8 ? "light" : "dark";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return "dark";
|
|
97
|
+
}
|
|
@@ -19,6 +19,9 @@ export * as acp from "./acp/index.js";
|
|
|
19
19
|
export * as dashboard from "./dashboard/index.js";
|
|
20
20
|
export { createDashboard, shouldUseInteractiveDashboard } from "./dashboard/index.js";
|
|
21
21
|
export type { Dashboard, DashboardOptions } from "./dashboard/index.js";
|
|
22
|
+
export * as explorer from "./explorer/index.js";
|
|
23
|
+
export { runExplorer, singleDetail } from "./explorer/index.js";
|
|
24
|
+
export type { Row, DetailItem, Detail, DetailCtx, Action, ActionContext, ExplorerConfig, Tone, } from "./explorer/index.js";
|
|
22
25
|
export * as prompts from "./prompts/index.js";
|
|
23
26
|
export { intro, introPlain, outro, note, select, multiselect, text as promptText, confirm, confirmOrCancel, password, spinner, withSpinner, isCancel, cancel, log, PromptCancelledError } from "./prompts/index.js";
|
|
24
27
|
export type { SelectOptions, MultiselectOptions, TextOptions, ConfirmOptions, PasswordOptions, SpinnerOptions, WithSpinnerOptions } from "./prompts/index.js";
|
|
@@ -18,6 +18,9 @@ export * as acp from "./acp/index.js";
|
|
|
18
18
|
// Dashboard
|
|
19
19
|
export * as dashboard from "./dashboard/index.js";
|
|
20
20
|
export { createDashboard, shouldUseInteractiveDashboard } from "./dashboard/index.js";
|
|
21
|
+
// Explorer
|
|
22
|
+
export * as explorer from "./explorer/index.js";
|
|
23
|
+
export { runExplorer, singleDetail } from "./explorer/index.js";
|
|
21
24
|
// Prompts
|
|
22
25
|
export * as prompts from "./prompts/index.js";
|
|
23
26
|
export { intro, introPlain, outro, note, select, multiselect, text as promptText, confirm, confirmOrCancel, password, spinner, withSpinner, isCancel, cancel, log, PromptCancelledError } from "./prompts/index.js";
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
+
"postbuild": "node scripts/smoke-built-exports.cjs",
|
|
9
10
|
"lint": "cd ../.. && eslint packages/design-system --ext ts && tsc -p packages/design-system/tsconfig.json --noEmit",
|
|
10
11
|
"test": "cd ../.. && vitest run $(rg --files packages/design-system/src -g '*.test.ts' | sort | tr '\\n' ' ')",
|
|
11
12
|
"demo": "tsx scripts/demo.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft-openapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"auth-store": "^0.0.1",
|
|
35
35
|
"chalk": "^5.6.2",
|
|
36
36
|
"console-table-printer": "^2.15.0",
|
|
37
|
-
"toolcraft": "^0.0.
|
|
37
|
+
"toolcraft": "^0.0.18",
|
|
38
38
|
"yaml": "^2.8.2"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|