cngkit 1.1.12 → 1.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 +7 -5
- package/dist/{chunk-WD3MW5UT.js → chunk-7GF42VON.js} +2 -2
- package/dist/{chunk-C7FNUZYD.js → chunk-FGPQZ6ZK.js} +2 -2
- package/dist/{chunk-VCURAGDZ.js → chunk-JX33GP2L.js} +2 -2
- package/dist/{chunk-7Z74PS5X.js → chunk-Q3F7DVFP.js} +4 -3
- package/dist/chunk-Q3F7DVFP.js.map +1 -0
- package/dist/{chunk-IMOIIPGC.js → chunk-QGU4QBLQ.js} +3 -3
- package/dist/{chunk-4UBOEQN2.js → chunk-TSPDBGJM.js} +2 -2
- package/dist/{chunk-4UBOEQN2.js.map → chunk-TSPDBGJM.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/commands/coderoom/index.js +2 -2
- package/dist/commands/coderoom/join.js +5 -5
- package/dist/commands/coderoom/share.js +5 -5
- package/dist/commands/index.js +2 -2
- package/dist/commands/knowledges/audiences.js +5 -5
- package/dist/commands/knowledges/files.js +5 -5
- package/dist/commands/knowledges/glob.js +5 -5
- package/dist/commands/knowledges/grep.js +5 -5
- package/dist/commands/knowledges/index.js +2 -2
- package/dist/commands/knowledges/list.js +5 -5
- package/dist/commands/knowledges/read.js +5 -5
- package/dist/commands/knowledges/search.js +5 -5
- package/dist/commands/knowledges/status.js +5 -5
- package/dist/commands/login.js +3 -3
- package/dist/commands/scrub.js +2 -2
- package/dist/commands/transcripts.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-7Z74PS5X.js.map +0 -1
- /package/dist/{chunk-WD3MW5UT.js.map → chunk-7GF42VON.js.map} +0 -0
- /package/dist/{chunk-C7FNUZYD.js.map → chunk-FGPQZ6ZK.js.map} +0 -0
- /package/dist/{chunk-VCURAGDZ.js.map → chunk-JX33GP2L.js.map} +0 -0
- /package/dist/{chunk-IMOIIPGC.js.map → chunk-QGU4QBLQ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -244,6 +244,7 @@ results, and piped output stay clean. Set `CNGKIT_COLOR=never` to disable CLI co
|
|
|
244
244
|
- **Pastel** owns command and subcommand routing through files under `src/commands/`.
|
|
245
245
|
- **Ink** owns terminal rendering through built-in components such as `<Text>`.
|
|
246
246
|
- **marked-terminal** owns terminal Markdown rendering for help screens.
|
|
247
|
+
- **Chalk** owns the cngkit color theme passed into the Markdown renderer.
|
|
247
248
|
- **Zod** owns option and argument schemas for each route.
|
|
248
249
|
|
|
249
250
|
So yes, subcommands are built in through Pastel's nested route files. Adding a
|
|
@@ -261,9 +262,9 @@ src/commands/
|
|
|
261
262
|
```
|
|
262
263
|
|
|
263
264
|
The CLI does not hand-roll ANSI escape codes. Status styles go through Ink's built-in
|
|
264
|
-
`<Text color="..." bold dimColor>` support, and help screens
|
|
265
|
-
|
|
266
|
-
pipelines write raw lines instead.
|
|
265
|
+
`<Text color="..." bold dimColor>` support, and help screens render through
|
|
266
|
+
`marked-terminal` with a shared Chalk-backed theme. Commands that return content for agents
|
|
267
|
+
or shell pipelines write raw lines instead.
|
|
267
268
|
|
|
268
269
|
## For Contributors
|
|
269
270
|
|
|
@@ -274,7 +275,7 @@ src/
|
|
|
274
275
|
cli/ Pastel bootstrap support, help text, option schemas, Ink output runner
|
|
275
276
|
commands/ Thin Pastel route files
|
|
276
277
|
features/ Command behavior grouped by feature
|
|
277
|
-
shared/ Config, output, browser, API client, shared command utilities
|
|
278
|
+
shared/ Config, theme, output, browser, API client, shared command utilities
|
|
278
279
|
```
|
|
279
280
|
|
|
280
281
|
The route files under `src/commands/` should stay thin. Put behavior in
|
|
@@ -301,7 +302,8 @@ pnpm --filter cngkit run deploy
|
|
|
301
302
|
```
|
|
302
303
|
|
|
303
304
|
That command runs typecheck, lint, build, smoke, npm pack dry-run, npm publish, registry
|
|
304
|
-
verification,
|
|
305
|
+
verification, exact global install of the published version, and a final global
|
|
306
|
+
`cngkit --version` check.
|
|
305
307
|
|
|
306
308
|
The package build uses `tsup` to emit a file-preserving ESM build. The published binary is
|
|
307
309
|
`dist/cli.js`, and Pastel discovers command files under `dist/commands/**`.
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-QZEB4VMX.js";
|
|
7
7
|
import {
|
|
8
8
|
createCngApiClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FGPQZ6ZK.js";
|
|
10
10
|
|
|
11
11
|
// src/features/knowledges/knowledges-api.ts
|
|
12
12
|
function createKnowledgesApi(options) {
|
|
@@ -316,4 +316,4 @@ export {
|
|
|
316
316
|
runKnowGrepCommand,
|
|
317
317
|
runKnowGlobCommand
|
|
318
318
|
};
|
|
319
|
-
//# sourceMappingURL=chunk-
|
|
319
|
+
//# sourceMappingURL=chunk-7GF42VON.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveApiBaseUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TSPDBGJM.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
6
|
} from "./chunk-PZ5AY32C.js";
|
|
@@ -3231,4 +3231,4 @@ export {
|
|
|
3231
3231
|
createCngApiClient,
|
|
3232
3232
|
readBackendHealth
|
|
3233
3233
|
};
|
|
3234
|
-
//# sourceMappingURL=chunk-
|
|
3234
|
+
//# sourceMappingURL=chunk-FGPQZ6ZK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCommandOutput,
|
|
3
3
|
formatError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q3F7DVFP.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/command-runner.tsx
|
|
7
7
|
import { useEffect } from "react";
|
|
@@ -23,4 +23,4 @@ function CommandRunner({ run }) {
|
|
|
23
23
|
export {
|
|
24
24
|
CommandRunner
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-JX33GP2L.js.map
|
|
@@ -48,7 +48,7 @@ function createMarkdownTheme(useColor) {
|
|
|
48
48
|
del: chalk.dim.strikethrough,
|
|
49
49
|
link: chalk.blueBright,
|
|
50
50
|
href: chalk.blue.underline,
|
|
51
|
-
text:
|
|
51
|
+
text: identity,
|
|
52
52
|
showSectionPrefix: true,
|
|
53
53
|
reflowText: true,
|
|
54
54
|
unescape: true,
|
|
@@ -134,11 +134,12 @@ function formatMarkdownMessage(stream, markdown) {
|
|
|
134
134
|
return markdown;
|
|
135
135
|
}
|
|
136
136
|
const useColor = shouldRenderColor(stream);
|
|
137
|
+
const markdownWidth = clampMarkdownWidth(stream.columns);
|
|
137
138
|
const parser = new Marked();
|
|
138
139
|
parser.use(
|
|
139
140
|
markedTerminal({
|
|
140
141
|
...createMarkdownTheme(useColor),
|
|
141
|
-
width:
|
|
142
|
+
width: markdownWidth
|
|
142
143
|
})
|
|
143
144
|
);
|
|
144
145
|
const renderedMarkdown = String(parser.parse(markdown)).trimEnd();
|
|
@@ -169,4 +170,4 @@ export {
|
|
|
169
170
|
createCommandOutput,
|
|
170
171
|
formatError
|
|
171
172
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-Q3F7DVFP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/output.ts","../src/shared/theme.ts"],"sourcesContent":["import process from \"node:process\";\nimport { Marked, type MarkedExtension } from \"marked\";\nimport { markedTerminal } from \"marked-terminal\";\nimport { createElement } from \"react\";\nimport { renderToString, Text } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\nimport {\n createMarkdownTheme,\n decorateMarkdownOutput,\n statusStylePropsByOutputStyle,\n type OutputStyle,\n} from \"./theme.js\";\n\ntype OutputStream = NodeJS.WriteStream & {\n isTTY?: boolean;\n columns?: number;\n};\n\nexport type CommandOutput = {\n info(message: string): void;\n success(message: string): void;\n warning(message: string): void;\n muted(message: string): void;\n markdown(message: string): void;\n raw(message: string): void;\n error(message: string): void;\n};\n\nexport const consoleOutput = createCommandOutput(process.stdout, process.stderr);\n\nexport function createCommandOutput(stdout: OutputStream, stderr: OutputStream): CommandOutput {\n return {\n info(message) {\n writeStyledMessage(stdout, \"info\", message);\n },\n success(message) {\n writeStyledMessage(stdout, \"success\", message);\n },\n warning(message) {\n writeStyledMessage(stdout, \"warning\", message);\n },\n muted(message) {\n writeStyledMessage(stdout, \"muted\", message);\n },\n markdown(message) {\n stdout.write(`${formatMarkdownMessage(stdout, message)}\\n`);\n },\n raw(message) {\n stdout.write(`${message}\\n`);\n },\n error(message) {\n writeStyledMessage(stderr, \"error\", message);\n },\n };\n}\n\nexport function formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction writeStyledMessage(stream: OutputStream, style: OutputStyle, message: string): void {\n stream.write(`${formatStyledMessage(stream, style, message)}\\n`);\n}\n\nfunction formatStyledMessage(stream: OutputStream, style: OutputStyle, message: string): string {\n if (!shouldRenderColor(stream)) {\n return message;\n }\n\n return renderToString(\n createElement(\n Text,\n {\n ...statusStylePropsByOutputStyle[style],\n wrap: \"wrap\",\n },\n message\n ),\n {\n columns: 10_000,\n }\n );\n}\n\nfunction formatMarkdownMessage(stream: OutputStream, markdown: string): string {\n if (stream.isTTY !== true) {\n return markdown;\n }\n\n const useColor = shouldRenderColor(stream);\n const markdownWidth = clampMarkdownWidth(stream.columns);\n const parser = new Marked();\n parser.use(\n markedTerminal({\n ...createMarkdownTheme(useColor),\n width: markdownWidth,\n }) as unknown as MarkedExtension\n );\n\n const renderedMarkdown = String(parser.parse(markdown)).trimEnd();\n\n return useColor ? decorateMarkdownOutput(renderedMarkdown) : stripAnsi(renderedMarkdown);\n}\n\nfunction shouldRenderColor(stream: OutputStream): boolean {\n const colorMode = process.env.CNGKIT_COLOR?.toLowerCase();\n\n if (colorMode === \"never\" || colorMode === \"0\" || colorMode === \"false\") {\n return false;\n }\n\n if (colorMode === \"always\" || colorMode === \"1\" || colorMode === \"true\") {\n return true;\n }\n\n if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== \"0\") {\n return true;\n }\n\n return stream.isTTY === true;\n}\n\nfunction clampMarkdownWidth(columns: number | undefined): number {\n if (columns === undefined) {\n return 100;\n }\n\n return Math.max(72, Math.min(columns, 120));\n}\n","import { Chalk } from \"chalk\";\nimport type { TextProps } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\n\nexport type OutputStyle = \"info\" | \"success\" | \"warning\" | \"muted\" | \"error\";\n\nexport const statusStylePropsByOutputStyle = {\n info: {\n color: \"cyan\",\n },\n success: {\n color: \"green\",\n bold: true,\n },\n warning: {\n color: \"yellow\",\n bold: true,\n },\n muted: {\n dimColor: true,\n },\n error: {\n color: \"red\",\n bold: true,\n },\n} satisfies Record<OutputStyle, TextProps>;\n\nexport function createMarkdownTheme(useColor: boolean) {\n const chalk = new Chalk({ level: useColor ? 1 : 0 });\n const identity = (value: string) => value;\n\n return {\n code: chalk.green,\n blockquote: chalk.dim.italic,\n html: chalk.gray,\n heading: chalk.blueBright.bold,\n firstHeading: chalk.magentaBright.bold,\n hr: chalk.gray,\n listitem: identity,\n table: identity,\n paragraph: identity,\n strong: chalk.bold,\n em: chalk.italic,\n codespan: chalk.cyanBright,\n del: chalk.dim.strikethrough,\n link: chalk.blueBright,\n href: chalk.blue.underline,\n text: identity,\n showSectionPrefix: true,\n reflowText: true,\n unescape: true,\n emoji: false,\n tab: 2,\n };\n}\n\nexport function decorateMarkdownOutput(output: string): string {\n const chalk = new Chalk({ level: 1 });\n\n const decoratedLines = output\n .split(\"\\n\")\n .map((line) => {\n const plainLine = stripAnsi(line);\n\n if (plainLine.startsWith(\"# \")) {\n return chalk.magentaBright.bold(plainLine);\n }\n\n if (plainLine.startsWith(\"## \")) {\n return chalk.blueBright.bold(plainLine);\n }\n\n return line;\n })\n .join(\"\\n\");\n\n return decoratedLines\n .replace(/`([^`\\n]+)`/g, (_match, value: string) => chalk.cyanBright(value))\n .replace(/(^|\\s)(--[a-z][a-z0-9-]*)/g, (_match, prefix: string, flag: string) => {\n return `${prefix}${chalk.yellow(flag)}`;\n })\n .replace(/(https?:\\/\\/[^\\s)]+)/g, (url: string) => chalk.blueBright.underline(url))\n .replace(/^(\\s*)\\*\\s+/gm, (_match, prefix: string) => {\n return `${prefix}${chalk.magentaBright(\"-\")} `;\n });\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,cAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,YAAY;AACrC,OAAOA,gBAAe;;;ACLtB,SAAS,aAAa;AAEtB,OAAO,eAAe;AAIf,IAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;AAEO,SAAS,oBAAoB,UAAmB;AACrD,QAAM,QAAQ,IAAI,MAAM,EAAE,OAAO,WAAW,IAAI,EAAE,CAAC;AACnD,QAAM,WAAW,CAAC,UAAkB;AAEpC,SAAO;AAAA,IACL,MAAM,MAAM;AAAA,IACZ,YAAY,MAAM,IAAI;AAAA,IACtB,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM,WAAW;AAAA,IAC1B,cAAc,MAAM,cAAc;AAAA,IAClC,IAAI,MAAM;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ,MAAM;AAAA,IACd,IAAI,MAAM;AAAA,IACV,UAAU,MAAM;AAAA,IAChB,KAAK,MAAM,IAAI;AAAA,IACf,MAAM,MAAM;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uB,gBAAgB,IAAIC,WAAU,gBAAgB;AACzF;AAEA,SAAS,kBAAkB,QAA+B;AACxD,QAAM,YAAY,QAAQ,IAAI,cAAc,YAAY;AAExD,MAAI,cAAc,WAAW,cAAc,OAAO,cAAc,SAAS;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,cAAc,YAAY,cAAc,OAAO,cAAc,QAAQ;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,gBAAgB,UAAa,QAAQ,IAAI,gBAAgB,KAAK;AAC5E,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,mBAAmB,SAAqC;AAC/D,MAAI,YAAY,QAAW;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,IAAI,IAAI,KAAK,IAAI,SAAS,GAAG,CAAC;AAC5C;","names":["stripAnsi","stripAnsi"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readBackendHealth
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FGPQZ6ZK.js";
|
|
4
4
|
import {
|
|
5
5
|
createPeerId,
|
|
6
6
|
createRoomCode,
|
|
7
7
|
resolveApiBaseUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TSPDBGJM.js";
|
|
9
9
|
|
|
10
10
|
// src/features/coderoom/run-coderoom-command.ts
|
|
11
11
|
import process2 from "process";
|
|
@@ -412,4 +412,4 @@ export {
|
|
|
412
412
|
runShareCommand,
|
|
413
413
|
runJoinCommand
|
|
414
414
|
};
|
|
415
|
-
//# sourceMappingURL=chunk-
|
|
415
|
+
//# sourceMappingURL=chunk-QGU4QBLQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/shared/config.ts
|
|
2
2
|
import { randomBytes, randomUUID } from "crypto";
|
|
3
3
|
import process from "process";
|
|
4
|
-
var packageVersion = "1.1.
|
|
4
|
+
var packageVersion = "1.1.13";
|
|
5
5
|
var defaultApiBaseUrl = "https://curly.ng";
|
|
6
6
|
function resolveApiBaseUrl(options) {
|
|
7
7
|
return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
createRoomCode,
|
|
20
20
|
createPeerId
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-TSPDBGJM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/config.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\";\nimport process from \"node:process\";\n\nexport const packageVersion = \"1.1.
|
|
1
|
+
{"version":3,"sources":["../src/shared/config.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\";\nimport process from \"node:process\";\n\nexport const packageVersion = \"1.1.13\";\nexport const defaultApiBaseUrl = \"https://curly.ng\";\n\nexport type GlobalCommandOptions = {\n apiBaseUrl?: string;\n};\n\nexport function resolveApiBaseUrl(options: GlobalCommandOptions): string {\n return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;\n}\n\nexport function createRoomCode(): string {\n return randomBytes(4).toString(\"hex\").toUpperCase();\n}\n\nexport function createPeerId(): string {\n return randomUUID();\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAO,aAAa;AAEb,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAM1B,SAAS,kBAAkB,SAAuC;AACvE,SAAO,QAAQ,cAAc,QAAQ,IAAI,uBAAuB;AAClE;AAEO,SAAS,iBAAyB;AACvC,SAAO,YAAY,CAAC,EAAE,SAAS,KAAK,EAAE,YAAY;AACpD;AAEO,SAAS,eAAuB;AACrC,SAAO,WAAW;AACpB;","names":[]}
|
package/dist/cli.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
} from "./chunk-S6LINZSY.js";
|
|
6
6
|
import {
|
|
7
7
|
packageVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TSPDBGJM.js";
|
|
9
9
|
import {
|
|
10
10
|
consoleOutput,
|
|
11
11
|
formatError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Q3F7DVFP.js";
|
|
13
13
|
import "./chunk-PZ5AY32C.js";
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../../chunk-MLKBG5YJ.js";
|
|
7
7
|
import {
|
|
8
8
|
CommandRunner
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-JX33GP2L.js";
|
|
10
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
11
11
|
import "../../chunk-PZ5AY32C.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/coderoom/index.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runJoinCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-QGU4QBLQ.js";
|
|
4
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
5
|
+
import "../../chunk-TSPDBGJM.js";
|
|
6
6
|
import {
|
|
7
7
|
GlobalOptionsSchema,
|
|
8
8
|
RequiredRoomCodeArgsSchema
|
|
9
9
|
} from "../../chunk-MLKBG5YJ.js";
|
|
10
10
|
import {
|
|
11
11
|
CommandRunner
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-JX33GP2L.js";
|
|
13
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
14
14
|
import "../../chunk-PZ5AY32C.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/coderoom/join.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runShareCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-QGU4QBLQ.js";
|
|
4
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
5
|
+
import "../../chunk-TSPDBGJM.js";
|
|
6
6
|
import {
|
|
7
7
|
GlobalOptionsSchema,
|
|
8
8
|
OptionalRoomCodeArgsSchema
|
|
9
9
|
} from "../../chunk-MLKBG5YJ.js";
|
|
10
10
|
import {
|
|
11
11
|
CommandRunner
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-JX33GP2L.js";
|
|
13
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
14
14
|
import "../../chunk-PZ5AY32C.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/coderoom/share.tsx
|
package/dist/commands/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../chunk-S6LINZSY.js";
|
|
4
4
|
import {
|
|
5
5
|
CommandRunner
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-JX33GP2L.js";
|
|
7
|
+
import "../chunk-Q3F7DVFP.js";
|
|
8
8
|
import "../chunk-PZ5AY32C.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/index.tsx
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowAudiencesCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
JsonOutputOptionsSchema
|
|
10
10
|
} from "../../chunk-MLKBG5YJ.js";
|
|
11
11
|
import {
|
|
12
12
|
CommandRunner
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-JX33GP2L.js";
|
|
14
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
15
15
|
import "../../chunk-PZ5AY32C.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/knowledges/audiences.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowFilesCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
JsonOutputOptionsSchema,
|
|
10
10
|
OptionalQueryArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/files.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowGlobCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
LimitOptionsSchema,
|
|
10
10
|
OptionalGlobPatternArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/glob.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowGrepCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
LimitOptionsSchema,
|
|
10
10
|
RequiredPatternArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/grep.tsx
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../../chunk-MLKBG5YJ.js";
|
|
7
7
|
import {
|
|
8
8
|
CommandRunner
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-JX33GP2L.js";
|
|
10
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
11
11
|
import "../../chunk-PZ5AY32C.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/knowledges/index.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowListCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
LimitOptionsSchema,
|
|
10
10
|
OptionalQueryArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/list.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowReadCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
JsonOutputOptionsSchema,
|
|
10
10
|
RequiredFilePathArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/read.tsx
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowSearchCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
LimitOptionsSchema,
|
|
10
10
|
RequiredQueryArgsSchema
|
|
11
11
|
} from "../../chunk-MLKBG5YJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CommandRunner
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-JX33GP2L.js";
|
|
15
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
16
16
|
import "../../chunk-PZ5AY32C.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/knowledges/search.tsx
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runKnowStatusCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-7GF42VON.js";
|
|
4
4
|
import "../../chunk-QZEB4VMX.js";
|
|
5
5
|
import "../../chunk-S6LINZSY.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-FGPQZ6ZK.js";
|
|
7
|
+
import "../../chunk-TSPDBGJM.js";
|
|
8
8
|
import {
|
|
9
9
|
JsonOutputOptionsSchema
|
|
10
10
|
} from "../../chunk-MLKBG5YJ.js";
|
|
11
11
|
import {
|
|
12
12
|
CommandRunner
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-JX33GP2L.js";
|
|
14
|
+
import "../../chunk-Q3F7DVFP.js";
|
|
15
15
|
import "../../chunk-PZ5AY32C.js";
|
|
16
16
|
|
|
17
17
|
// src/commands/knowledges/status.tsx
|
package/dist/commands/login.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveApiBaseUrl
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TSPDBGJM.js";
|
|
4
4
|
import {
|
|
5
5
|
GlobalOptionsSchema
|
|
6
6
|
} from "../chunk-MLKBG5YJ.js";
|
|
7
7
|
import {
|
|
8
8
|
CommandRunner
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-JX33GP2L.js";
|
|
10
|
+
import "../chunk-Q3F7DVFP.js";
|
|
11
11
|
import "../chunk-PZ5AY32C.js";
|
|
12
12
|
|
|
13
13
|
// src/shared/browser.ts
|
package/dist/commands/scrub.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-MLKBG5YJ.js";
|
|
5
5
|
import {
|
|
6
6
|
CommandRunner
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-JX33GP2L.js";
|
|
8
|
+
import "../chunk-Q3F7DVFP.js";
|
|
9
9
|
import "../chunk-PZ5AY32C.js";
|
|
10
10
|
|
|
11
11
|
// src/commands/scrub.tsx
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from "../chunk-MLKBG5YJ.js";
|
|
14
14
|
import {
|
|
15
15
|
CommandRunner
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-JX33GP2L.js";
|
|
17
|
+
import "../chunk-Q3F7DVFP.js";
|
|
18
18
|
import "../chunk-PZ5AY32C.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/transcripts.tsx
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shared/output.ts","../src/shared/theme.ts"],"sourcesContent":["import process from \"node:process\";\nimport { Marked, type MarkedExtension } from \"marked\";\nimport { markedTerminal } from \"marked-terminal\";\nimport { createElement } from \"react\";\nimport { renderToString, Text } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\nimport {\n createMarkdownTheme,\n decorateMarkdownOutput,\n statusStylePropsByOutputStyle,\n type OutputStyle,\n} from \"./theme.js\";\n\ntype OutputStream = NodeJS.WriteStream & {\n isTTY?: boolean;\n columns?: number;\n};\n\nexport type CommandOutput = {\n info(message: string): void;\n success(message: string): void;\n warning(message: string): void;\n muted(message: string): void;\n markdown(message: string): void;\n raw(message: string): void;\n error(message: string): void;\n};\n\nexport const consoleOutput = createCommandOutput(process.stdout, process.stderr);\n\nexport function createCommandOutput(stdout: OutputStream, stderr: OutputStream): CommandOutput {\n return {\n info(message) {\n writeStyledMessage(stdout, \"info\", message);\n },\n success(message) {\n writeStyledMessage(stdout, \"success\", message);\n },\n warning(message) {\n writeStyledMessage(stdout, \"warning\", message);\n },\n muted(message) {\n writeStyledMessage(stdout, \"muted\", message);\n },\n markdown(message) {\n stdout.write(`${formatMarkdownMessage(stdout, message)}\\n`);\n },\n raw(message) {\n stdout.write(`${message}\\n`);\n },\n error(message) {\n writeStyledMessage(stderr, \"error\", message);\n },\n };\n}\n\nexport function formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction writeStyledMessage(stream: OutputStream, style: OutputStyle, message: string): void {\n stream.write(`${formatStyledMessage(stream, style, message)}\\n`);\n}\n\nfunction formatStyledMessage(stream: OutputStream, style: OutputStyle, message: string): string {\n if (!shouldRenderColor(stream)) {\n return message;\n }\n\n return renderToString(\n createElement(\n Text,\n {\n ...statusStylePropsByOutputStyle[style],\n wrap: \"wrap\",\n },\n message\n ),\n {\n columns: 10_000,\n }\n );\n}\n\nfunction formatMarkdownMessage(stream: OutputStream, markdown: string): string {\n if (stream.isTTY !== true) {\n return markdown;\n }\n\n const useColor = shouldRenderColor(stream);\n const parser = new Marked();\n parser.use(\n markedTerminal({\n ...createMarkdownTheme(useColor),\n width: clampMarkdownWidth(stream.columns),\n }) as unknown as MarkedExtension\n );\n\n const renderedMarkdown = String(parser.parse(markdown)).trimEnd();\n return useColor ? decorateMarkdownOutput(renderedMarkdown) : stripAnsi(renderedMarkdown);\n}\n\nfunction shouldRenderColor(stream: OutputStream): boolean {\n const colorMode = process.env.CNGKIT_COLOR?.toLowerCase();\n\n if (colorMode === \"never\" || colorMode === \"0\" || colorMode === \"false\") {\n return false;\n }\n\n if (colorMode === \"always\" || colorMode === \"1\" || colorMode === \"true\") {\n return true;\n }\n\n if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== \"0\") {\n return true;\n }\n\n return stream.isTTY === true;\n}\n\nfunction clampMarkdownWidth(columns: number | undefined): number {\n if (columns === undefined) {\n return 100;\n }\n\n return Math.max(72, Math.min(columns, 120));\n}\n","import { Chalk } from \"chalk\";\nimport type { TextProps } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\n\nexport type OutputStyle = \"info\" | \"success\" | \"warning\" | \"muted\" | \"error\";\n\nexport const statusStylePropsByOutputStyle = {\n info: {\n color: \"cyan\",\n },\n success: {\n color: \"green\",\n bold: true,\n },\n warning: {\n color: \"yellow\",\n bold: true,\n },\n muted: {\n dimColor: true,\n },\n error: {\n color: \"red\",\n bold: true,\n },\n} satisfies Record<OutputStyle, TextProps>;\n\nexport function createMarkdownTheme(useColor: boolean) {\n const chalk = new Chalk({ level: useColor ? 1 : 0 });\n const identity = (value: string) => value;\n\n return {\n code: chalk.green,\n blockquote: chalk.dim.italic,\n html: chalk.gray,\n heading: chalk.blueBright.bold,\n firstHeading: chalk.magentaBright.bold,\n hr: chalk.gray,\n listitem: identity,\n table: identity,\n paragraph: identity,\n strong: chalk.bold,\n em: chalk.italic,\n codespan: chalk.cyanBright,\n del: chalk.dim.strikethrough,\n link: chalk.blueBright,\n href: chalk.blue.underline,\n text: chalk.reset,\n showSectionPrefix: true,\n reflowText: true,\n unescape: true,\n emoji: false,\n tab: 2,\n };\n}\n\nexport function decorateMarkdownOutput(output: string): string {\n const chalk = new Chalk({ level: 1 });\n\n const decoratedLines = output\n .split(\"\\n\")\n .map((line) => {\n const plainLine = stripAnsi(line);\n\n if (plainLine.startsWith(\"# \")) {\n return chalk.magentaBright.bold(plainLine);\n }\n\n if (plainLine.startsWith(\"## \")) {\n return chalk.blueBright.bold(plainLine);\n }\n\n return line;\n })\n .join(\"\\n\");\n\n return decoratedLines\n .replace(/`([^`\\n]+)`/g, (_match, value: string) => chalk.cyanBright(value))\n .replace(/(^|\\s)(--[a-z][a-z0-9-]*)/g, (_match, prefix: string, flag: string) => {\n return `${prefix}${chalk.yellow(flag)}`;\n })\n .replace(/(https?:\\/\\/[^\\s)]+)/g, (url: string) => chalk.blueBright.underline(url))\n .replace(/^(\\s*)\\*\\s+/gm, (_match, prefix: string) => {\n return `${prefix}${chalk.magentaBright(\"-\")} `;\n });\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,cAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,YAAY;AACrC,OAAOA,gBAAe;;;ACLtB,SAAS,aAAa;AAEtB,OAAO,eAAe;AAIf,IAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA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AAAA,QACE,GAAG,8BAA8B,KAAK;AAAA,QACtC,MAAM;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,SAAS,sBAAsB,QAAsB,UAA0B;AAC7E,MAAI,OAAO,UAAU,MAAM;AACzB,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,kBAAkB,MAAM;AACzC,QAAM,SAAS,IAAI,OAAO;AAC1B,SAAO;AAAA,IACL,eAAe;AAAA,MACb,GAAG,oBAAoB,QAAQ;AAAA,MAC/B,OAAO,mBAAmB,OAAO,OAAO;AAAA,IAC1C,CAAC;AAAA,EACH;AAEA,QAAM,mBAAmB,OAAO,OAAO,MAAM,QAAQ,CAAC,EAAE,QAAQ;AAChE,SAAO,WAAW,uBAAuB,gBAAgB,IAAIC,WAAU,gBAAgB;AACzF;AAEA,SAAS,kBAAkB,QAA+B;AACxD,QAAM,YAAY,QAAQ,IAAI,cAAc,YAAY;AAExD,MAAI,cAAc,WAAW,cAAc,OAAO,cAAc,SAAS;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,cAAc,YAAY,cAAc,OAAO,cAAc,QAAQ;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,gBAAgB,UAAa,QAAQ,IAAI,gBAAgB,KAAK;AAC5E,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,mBAAmB,SAAqC;AAC/D,MAAI,YAAY,QAAW;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,IAAI,IAAI,KAAK,IAAI,SAAS,GAAG,CAAC;AAC5C;","names":["stripAnsi","stripAnsi"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|