assistant-ui 0.0.122 → 0.0.123
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PackageManagerName } from "./utils/package-manager.js";
|
|
2
2
|
export declare const SKILLS_PACKAGE = "assistant-ui/skills";
|
|
3
|
-
export declare const SKILLS_COMMIT = "
|
|
4
|
-
export declare const SKILLS_PLUGIN_SOURCE = "gh:assistant-ui/skills/assistant-ui#
|
|
3
|
+
export declare const SKILLS_COMMIT = "1ba8e9105c504fe4ac2591e432783872d6b3c8ba";
|
|
4
|
+
export declare const SKILLS_PLUGIN_SOURCE = "gh:assistant-ui/skills/assistant-ui#1ba8e9105c504fe4ac2591e432783872d6b3c8ba";
|
|
5
5
|
export declare function resolveSkillsInstall(params: {
|
|
6
6
|
skills?: boolean;
|
|
7
7
|
stdinIsTTY?: boolean;
|
package/dist/lib/agent-skill.js
CHANGED
|
@@ -5,7 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
//#region src/lib/agent-skill.ts
|
|
7
7
|
const SKILLS_PACKAGE = "assistant-ui/skills";
|
|
8
|
-
const SKILLS_COMMIT = "
|
|
8
|
+
const SKILLS_COMMIT = "1ba8e9105c504fe4ac2591e432783872d6b3c8ba";
|
|
9
9
|
const SKILLS_PLUGIN_SOURCE = `gh:${SKILLS_PACKAGE}/assistant-ui#${SKILLS_COMMIT}`;
|
|
10
10
|
function resolveSkillsInstall(params) {
|
|
11
11
|
const { skills, stdinIsTTY = process.stdin.isTTY } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-skill.js","names":[],"sources":["../../src/lib/agent-skill.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { withStagedDownload } from \"./utils/download\";\nimport { dlxCommand, type PackageManagerName } from \"./utils/package-manager\";\n\nexport const SKILLS_PACKAGE = \"assistant-ui/skills\";\nexport const SKILLS_COMMIT = \"
|
|
1
|
+
{"version":3,"file":"agent-skill.js","names":[],"sources":["../../src/lib/agent-skill.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { withStagedDownload } from \"./utils/download\";\nimport { dlxCommand, type PackageManagerName } from \"./utils/package-manager\";\n\nexport const SKILLS_PACKAGE = \"assistant-ui/skills\";\nexport const SKILLS_COMMIT = \"1ba8e9105c504fe4ac2591e432783872d6b3c8ba\";\nexport const SKILLS_PLUGIN_SOURCE = `gh:${SKILLS_PACKAGE}/assistant-ui#${SKILLS_COMMIT}`;\n\nexport function resolveSkillsInstall(params: {\n skills?: boolean;\n stdinIsTTY?: boolean;\n}): boolean | undefined {\n const { skills, stdinIsTTY = process.stdin.isTTY } = params;\n if (skills !== undefined) return skills;\n if (!stdinIsTTY) return true;\n return undefined;\n}\n\nexport function buildSkillsAddCommand(\n pm: PackageManagerName,\n params: { stdinIsTTY?: boolean } = {},\n): [string, string[]] {\n const { stdinIsTTY = process.stdin.isTTY } = params;\n const [command, dlxArgs] = dlxCommand(pm);\n const args = [...dlxArgs, \"skills\", \"add\", SKILLS_PACKAGE];\n\n // Without a TTY the skills CLI cannot prompt for agent platforms, so skip its\n // confirmation; with a TTY it owns the platform selection interactively.\n if (!stdinIsTTY) args.push(\"--yes\");\n\n return [command, args];\n}\n\nexport function skillsPluginDir(): string {\n const cacheHome =\n process.env.XDG_CACHE_HOME || path.join(os.homedir(), \".cache\");\n return path.join(cacheHome, \"assistant-ui\", \"skills\", SKILLS_COMMIT);\n}\n\nexport async function ensureSkillsPlugin(): Promise<string> {\n const dir = skillsPluginDir();\n const marker = path.join(dir, \".claude-plugin\", \"plugin.json\");\n if (fs.existsSync(marker)) return dir;\n\n const parent = path.dirname(dir);\n await fs.promises.mkdir(parent, { recursive: true });\n const staging = await fs.promises.mkdtemp(path.join(parent, \".staging-\"));\n // Node emits no \"exit\" when a signal kills the process, so the staging\n // directory is removed on the signal and the signal re-raised. The\n // listeners stay armed until the removal runs, which a download that\n // outlives the timeout defers past the caller's own exit.\n const removeStaging = () => {\n process.removeListener(\"exit\", removeStaging);\n process.removeListener(\"SIGINT\", removeStagingOnSignal);\n process.removeListener(\"SIGTERM\", removeStagingOnSignal);\n fs.rmSync(staging, { recursive: true, force: true });\n };\n const removeStagingOnSignal = (signal: NodeJS.Signals) => {\n removeStaging();\n process.kill(process.pid, signal);\n };\n process.once(\"exit\", removeStaging);\n process.once(\"SIGINT\", removeStagingOnSignal);\n process.once(\"SIGTERM\", removeStagingOnSignal);\n\n await withStagedDownload(\n SKILLS_PLUGIN_SOURCE,\n { dir: staging, preferOffline: true, silent: true },\n \"Download timed out.\",\n removeStaging,\n async (download) => {\n await download.catch((error: unknown) => {\n throw new Error(\n \"Could not fetch the assistant-ui skills from GitHub. Check your network, or set GITHUB_TOKEN if you are rate limited.\",\n { cause: error },\n );\n });\n await publish(staging, dir, marker);\n },\n );\n\n return dir;\n}\n\n// A rename fails when the target directory exists and is not empty. A\n// concurrent invocation that published the same commit meanwhile wins and\n// the staged copy is dropped; a directory without the marker is a stale\n// partial cache and is replaced.\nasync function publish(\n staging: string,\n dir: string,\n marker: string,\n retry = true,\n): Promise<void> {\n try {\n await fs.promises.rename(staging, dir);\n } catch (error) {\n if (fs.existsSync(marker)) return;\n if (!retry) throw error;\n await fs.promises.rm(dir, { recursive: true, force: true });\n await publish(staging, dir, marker, false);\n }\n}\n"],"mappings":";;;;;;AAMA,MAAa,iBAAiB;AAC9B,MAAa,gBAAgB;AAC7B,MAAa,uBAAuB,MAAM,eAAe,gBAAgB;AAEzE,SAAgB,qBAAqB,QAGb;CACtB,MAAM,EAAE,QAAQ,aAAa,QAAQ,MAAM,UAAU;CACrD,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,IAAI,CAAC,YAAY,OAAO;AAE1B;AAEA,SAAgB,sBACd,IACA,SAAmC,CAAC,GAChB;CACpB,MAAM,E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ACjB;EACF,CAAC;EACD,MAAM,QAAQ,SAAS,KAAK,MAAM;CACpC,CACF;CAEA,OAAO;AACT;AAMA,eAAe,QACb,SACA,KACA,QACA,QAAQ,MACO;CACf,IAAI;EACF,MAAM,GAAG,SAAS,OAAO,SAAS,GAAG;CACvC,SAAS,OAAO;EACd,IAAI,GAAG,WAAW,MAAM,GAAG;EAC3B,IAAI,CAAC,OAAO,MAAM;EAClB,MAAM,GAAG,SAAS,GAAG,KAAK;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EAC1D,MAAM,QAAQ,SAAS,KAAK,QAAQ,KAAK;CAC3C;AACF"}
|
package/package.json
CHANGED
package/src/lib/agent-skill.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { withStagedDownload } from "./utils/download";
|
|
|
5
5
|
import { dlxCommand, type PackageManagerName } from "./utils/package-manager";
|
|
6
6
|
|
|
7
7
|
export const SKILLS_PACKAGE = "assistant-ui/skills";
|
|
8
|
-
export const SKILLS_COMMIT = "
|
|
8
|
+
export const SKILLS_COMMIT = "1ba8e9105c504fe4ac2591e432783872d6b3c8ba";
|
|
9
9
|
export const SKILLS_PLUGIN_SOURCE = `gh:${SKILLS_PACKAGE}/assistant-ui#${SKILLS_COMMIT}`;
|
|
10
10
|
|
|
11
11
|
export function resolveSkillsInstall(params: {
|