@sandbaseai/cli 0.1.6 → 0.1.8

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.
@@ -0,0 +1,53 @@
1
+ export declare const coworkMCPConfig = "{\n \"mcpServers\": {\n \"sandbase\": {\n \"command\": \"npx\",\n \"args\": [\"-y\", \"@sandbaseai/cli\", \"mcp-bridge\", \"--client\", \"cowork\"]\n }\n }\n}\n";
2
+ interface Source {
3
+ repository: string;
4
+ ref: string;
5
+ commit: string;
6
+ path: string;
7
+ }
8
+ interface Artifact {
9
+ kind: string;
10
+ version: string;
11
+ filename: string;
12
+ media_type: string;
13
+ sha256: string;
14
+ download_url: string;
15
+ source?: Source;
16
+ }
17
+ export interface CoworkManifest {
18
+ client: string;
19
+ artifacts: Artifact[];
20
+ }
21
+ export type CoworkStatus = "ready" | "missing" | "invalid";
22
+ export interface CoworkStateReadback {
23
+ ownership: CoworkStatus;
24
+ mcp: CoworkStatus;
25
+ skill: CoworkStatus;
26
+ admin: "confirmed" | "required" | "invalid";
27
+ }
28
+ export declare function coworkStatePath(home?: string): string;
29
+ export declare function readCoworkState(home?: string): Promise<CoworkStateReadback>;
30
+ export declare function recordCoworkArtifacts(manifest: CoworkManifest, mcpBytes?: Uint8Array, skillBytes?: Uint8Array, home?: string): Promise<{
31
+ path: string;
32
+ previous?: string;
33
+ changed: boolean;
34
+ readback: {
35
+ mcp: CoworkStatus;
36
+ skill: CoworkStatus;
37
+ };
38
+ }>;
39
+ export declare function confirmCoworkAdministrator(input: {
40
+ mechanism: string;
41
+ approved: boolean;
42
+ }, home?: string): Promise<{
43
+ path: string;
44
+ previous?: string;
45
+ changed: boolean;
46
+ }>;
47
+ export declare function rollbackCoworkState(result: {
48
+ path: string;
49
+ previous?: string;
50
+ changed: boolean;
51
+ }): Promise<void>;
52
+ export declare function removeCoworkState(home?: string): Promise<boolean>;
53
+ export {};
package/dist/cowork.js ADDED
@@ -0,0 +1,46 @@
1
+ import { createHash } from "node:crypto";
2
+ import { rm } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { atomicWrite, readOptional } from "./fs-safe.js";
5
+ import { sandbaseHome } from "./paths.js";
6
+ const owner = "sandbase-cli/cowork-connector";
7
+ const repository = "https://github.com/sandbaseai/sandbase-skills";
8
+ const commit = "a43b2272473615137c86637423285a641f64f64c";
9
+ const skillDigest = "4e32edb4f2f158333a19c7f64e777f354914adccd61314250770e2db7ff93087";
10
+ const mcpDigest = "d6a9cf4f1d4a8a3f3e7794f9996d7d35edd145efa5922c2e70e5f6f83559bae0";
11
+ export const coworkMCPConfig = '{\n "mcpServers": {\n "sandbase": {\n "command": "npx",\n "args": ["-y", "@sandbaseai/cli", "mcp-bridge", "--client", "cowork"]\n }\n }\n}\n';
12
+ const mcpState = { version: "1", sha256: mcpDigest };
13
+ const skillState = { version: "a43b227", sha256: skillDigest, source: { repository, ref: commit, commit, path: "SKILL.md" } };
14
+ const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
15
+ export function coworkStatePath(home = sandbaseHome()) { return join(home, "desktop", "cowork-connector.json"); }
16
+ function inspect(manifest, mcpBytes, skillBytes) { if (manifest?.client !== "cowork" || manifest.artifacts?.length !== 2)
17
+ return { mcp: manifest ? "invalid" : "missing", skill: manifest ? "invalid" : "missing" }; const mcp = manifest.artifacts.find(a => a.kind === "mcp-config"), skill = manifest.artifacts.find(a => a.kind === "skill"), source = skill?.source; const mcpReady = !!mcp && !!mcpBytes && mcp.version === "1" && mcp.filename === "sandbase-cowork-mcp.json" && mcp.media_type === "application/json" && mcp.sha256 === mcpDigest && mcp.download_url === "/default/v1/desktop-onboarding/cowork/artifacts/mcp-config" && sha256(mcpBytes) === mcpDigest && Buffer.from(mcpBytes).toString("utf8") === coworkMCPConfig; const skillReady = !!skill && !!skillBytes && skill.version === "a43b227" && skill.filename === "sandbase-skill.zip" && skill.media_type === "application/zip" && skill.sha256 === skillDigest && skill.download_url === "/default/v1/desktop-onboarding/cowork/artifacts/skill" && source?.repository === repository && source.ref === commit && source.commit === commit && source.path === "SKILL.md" && sha256(skillBytes) === skillDigest; return { mcp: !mcp || !mcpBytes ? "missing" : mcpReady ? "ready" : "invalid", skill: !skill || !skillBytes ? "missing" : skillReady ? "ready" : "invalid" }; }
18
+ function valid(value) { if (!value || typeof value !== "object" || Array.isArray(value))
19
+ return false; const s = value; return s.schemaVersion === 1 && s.owner === owner && s.client === "cowork" && s.mechanism === "account_workspace_admin" && (!s.mcp || JSON.stringify(s.mcp) === JSON.stringify(mcpState)) && (!s.skill || JSON.stringify(s.skill) === JSON.stringify(skillState)) && (s.adminConfirmed === undefined || s.adminConfirmed === true); }
20
+ export async function readCoworkState(home = sandbaseHome()) { const raw = await readOptional(coworkStatePath(home)); if (!raw)
21
+ return { ownership: "missing", mcp: "missing", skill: "missing", admin: "required" }; try {
22
+ const state = JSON.parse(raw);
23
+ if (!valid(state))
24
+ return { ownership: "invalid", mcp: "invalid", skill: "invalid", admin: "invalid" };
25
+ return { ownership: "ready", mcp: state.mcp ? "ready" : "missing", skill: state.skill ? "ready" : "missing", admin: state.adminConfirmed ? "confirmed" : "required" };
26
+ }
27
+ catch {
28
+ return { ownership: "invalid", mcp: "invalid", skill: "invalid", admin: "invalid" };
29
+ } }
30
+ async function update(home, mutate) { const path = coworkStatePath(home), previous = await readOptional(path), status = await readCoworkState(home); if (previous && status.ownership === "invalid")
31
+ throw new Error("Cowork connector ownership is unrecognized; no changes were made"); const state = previous ? JSON.parse(previous) : { schemaVersion: 1, owner, client: "cowork", mechanism: "account_workspace_admin" }; mutate(state); const next = JSON.stringify(state, null, 2) + "\n"; if (next === previous)
32
+ return { path, previous, changed: false }; await atomicWrite(path, next, 0o600); return { path, ...(previous === undefined ? {} : { previous }), changed: true }; }
33
+ export async function recordCoworkArtifacts(manifest, mcpBytes, skillBytes, home = sandbaseHome()) { const readback = inspect(manifest, mcpBytes, skillBytes); if (readback.mcp !== "ready" && readback.skill !== "ready")
34
+ return { path: coworkStatePath(home), changed: false, readback }; const result = await update(home, state => { if (readback.mcp === "ready")
35
+ state.mcp = mcpState; if (readback.skill === "ready")
36
+ state.skill = skillState; }); return { ...result, readback }; }
37
+ export async function confirmCoworkAdministrator(input, home = sandbaseHome()) { if (input.mechanism !== "account_workspace_admin" || input.approved !== true)
38
+ throw new Error("Cowork requires explicit account/workspace administrator confirmation; no changes were made"); return update(home, state => { state.adminConfirmed = true; }); }
39
+ export async function rollbackCoworkState(result) { if (!result.changed)
40
+ return; if (result.previous === undefined)
41
+ await rm(result.path, { force: true });
42
+ else
43
+ await atomicWrite(result.path, result.previous, 0o600); }
44
+ export async function removeCoworkState(home = sandbaseHome()) { const status = await readCoworkState(home); if (status.ownership === "missing")
45
+ return false; if (status.ownership === "invalid")
46
+ throw new Error("Cowork connector ownership is unrecognized; no changes were made"); await rm(coworkStatePath(home)); return true; }
@@ -0,0 +1,28 @@
1
+ import type { Client } from "./types.js";
2
+ export type DesktopClient = Extract<Client, "claude-desktop" | "cowork">;
3
+ export declare const desktopClients: readonly DesktopClient[];
4
+ declare const owner = "sandbase-cli/desktop-bridge";
5
+ export interface DesktopBridgeIdentity {
6
+ schemaVersion: 1;
7
+ owner: typeof owner;
8
+ client: DesktopClient;
9
+ launcher: "sandbase-mcp-bridge.mjs";
10
+ mcpArtifact: "mcp-config";
11
+ skillArtifact: "skill";
12
+ }
13
+ export declare function isDesktopClient(client: Client): client is DesktopClient;
14
+ export declare function desktopIdentityPath(client: DesktopClient, home?: string): string;
15
+ export declare function expectedDesktopIdentity(client: DesktopClient): DesktopBridgeIdentity;
16
+ export declare function readDesktopIdentity(client: DesktopClient, home?: string): Promise<"ready" | "missing" | "invalid">;
17
+ export declare function writeDesktopIdentity(client: DesktopClient, home?: string): Promise<{
18
+ path: string;
19
+ previous?: string;
20
+ changed: boolean;
21
+ }>;
22
+ export declare function rollbackDesktopIdentity(result: {
23
+ path: string;
24
+ previous?: string;
25
+ changed: boolean;
26
+ }): Promise<void>;
27
+ export declare function removeDesktopIdentity(client: DesktopClient, home?: string): Promise<boolean>;
28
+ export {};
@@ -0,0 +1,27 @@
1
+ import { rm } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { atomicWrite, readOptional } from "./fs-safe.js";
4
+ import { sandbaseHome } from "./paths.js";
5
+ export const desktopClients = ["claude-desktop", "cowork"];
6
+ const owner = "sandbase-cli/desktop-bridge";
7
+ export function isDesktopClient(client) { return desktopClients.includes(client); }
8
+ export function desktopIdentityPath(client, home = sandbaseHome()) { return join(home, "desktop", `${client}.json`); }
9
+ export function expectedDesktopIdentity(client) { return { schemaVersion: 1, owner, client, launcher: "sandbase-mcp-bridge.mjs", mcpArtifact: "mcp-config", skillArtifact: "skill" }; }
10
+ export async function readDesktopIdentity(client, home = sandbaseHome()) { const raw = await readOptional(desktopIdentityPath(client, home)); if (!raw)
11
+ return "missing"; try {
12
+ return JSON.stringify(JSON.parse(raw)) === JSON.stringify(expectedDesktopIdentity(client)) ? "ready" : "invalid";
13
+ }
14
+ catch {
15
+ return "invalid";
16
+ } }
17
+ export async function writeDesktopIdentity(client, home = sandbaseHome()) { const path = desktopIdentityPath(client, home); const previous = await readOptional(path); if (previous && await readDesktopIdentity(client, home) === "invalid")
18
+ throw new Error(`${client} SandBase artifact identity is unrecognized; no changes were made`); const next = JSON.stringify(expectedDesktopIdentity(client), null, 2) + "\n"; if (previous === next)
19
+ return { path, previous, changed: false }; await atomicWrite(path, next, 0o600); return { path, ...(previous === undefined ? {} : { previous }), changed: true }; }
20
+ export async function rollbackDesktopIdentity(result) { if (!result.changed)
21
+ return; if (result.previous === undefined)
22
+ await rm(result.path, { force: true });
23
+ else
24
+ await atomicWrite(result.path, result.previous, 0o600); }
25
+ export async function removeDesktopIdentity(client, home = sandbaseHome()) { const state = await readDesktopIdentity(client, home); if (state === "missing")
26
+ return false; if (state === "invalid")
27
+ throw new Error(`${client} SandBase artifact identity is unrecognized; no changes were made`); await rm(desktopIdentityPath(client, home)); return true; }
@@ -0,0 +1,26 @@
1
+ export type KiroIDEState = "missing" | "configured" | "confirmation_required" | "conflict" | "invalid";
2
+ export interface KiroIDEInspection {
3
+ state: KiroIDEState;
4
+ detail: string;
5
+ }
6
+ export interface KiroIDEResult {
7
+ path: string;
8
+ changed: boolean;
9
+ backup?: string;
10
+ identityPath: string;
11
+ identityChanged: boolean;
12
+ identityPrevious?: string;
13
+ }
14
+ export interface KiroIDEUnregisterSnapshot {
15
+ path: string;
16
+ config: string;
17
+ identityPath: string;
18
+ identity: string;
19
+ }
20
+ export declare function findKiroWorkspaceOverride(env?: NodeJS.ProcessEnv): Promise<string | undefined>;
21
+ export declare function inspectKiroIDE(env?: NodeJS.ProcessEnv, expectedBridge?: string): Promise<KiroIDEInspection>;
22
+ export declare function installKiroIDE(bridge: string, env?: NodeJS.ProcessEnv): Promise<KiroIDEResult>;
23
+ export declare function rollbackKiroIDE(result: KiroIDEResult): Promise<void>;
24
+ export declare function snapshotKiroIDEUnregister(env?: NodeJS.ProcessEnv): Promise<KiroIDEUnregisterSnapshot | undefined>;
25
+ export declare function restoreKiroIDEUnregister(snapshot: KiroIDEUnregisterSnapshot): Promise<void>;
26
+ export declare function unregisterKiroIDE(env?: NodeJS.ProcessEnv): Promise<boolean>;
@@ -0,0 +1,100 @@
1
+ import { dirname, isAbsolute, join } from "node:path";
2
+ import { rm } from "node:fs/promises";
3
+ import { atomicWrite, backup, readOptional, restore } from "./fs-safe.js";
4
+ import { configPath, sandbaseHome } from "./paths.js";
5
+ const marker = "sandbase-cli-kiro-ide-v1";
6
+ const ownerPath = (env = process.env) => join(sandbaseHome(env), "adapters", "kiro.json");
7
+ function object(value, label) { if (!value || typeof value !== "object" || Array.isArray(value))
8
+ throw new Error(`${label} must be an object`); return value; }
9
+ function root(raw, label) { return object(JSON.parse(raw), label); }
10
+ function entry(bridge) { return { command: "node", args: [bridge, "--client", "kiro"] }; }
11
+ function owned(value, bridge) { if (!value || typeof value !== "object" || Array.isArray(value))
12
+ return false; const candidate = value; return candidate.command === "node" && Array.isArray(candidate.args) && candidate.args.length === 3 && candidate.args[0] === bridge && candidate.args[1] === "--client" && candidate.args[2] === "kiro"; }
13
+ async function identity(env = process.env) { const raw = await readOptional(ownerPath(env)); if (raw === undefined)
14
+ return undefined; try {
15
+ const value = root(raw, "Kiro IDE identity");
16
+ return value.marker === marker && value.client === "kiro" && typeof value.bridge === "string" && isAbsolute(value.bridge) ? { bridge: value.bridge } : undefined;
17
+ }
18
+ catch {
19
+ return undefined;
20
+ } }
21
+ function parents(start) { const out = []; let current = start; for (;;) {
22
+ out.push(current);
23
+ const parent = dirname(current);
24
+ if (parent === current)
25
+ return out;
26
+ current = parent;
27
+ } }
28
+ export async function findKiroWorkspaceOverride(env = process.env) { const global = configPath("kiro", env); for (const directory of parents(env.PWD || process.cwd())) {
29
+ const path = join(directory, ".kiro", "settings", "mcp.json"), raw = await readOptional(path);
30
+ if (raw === undefined || path === global)
31
+ continue;
32
+ const parsed = root(raw, "Kiro workspace configuration"), servers = parsed.mcpServers === undefined ? {} : object(parsed.mcpServers, "Kiro workspace mcpServers");
33
+ if (servers.sandbase !== undefined)
34
+ return path;
35
+ } return undefined; }
36
+ export async function inspectKiroIDE(env = process.env, expectedBridge) { try {
37
+ const override = await findKiroWorkspaceOverride(env);
38
+ if (override)
39
+ return { state: "confirmation_required", detail: `higher-priority Kiro workspace SandBase entry at ${override} was left untouched` };
40
+ const raw = await readOptional(configPath("kiro", env));
41
+ if (raw === undefined)
42
+ return { state: "missing", detail: "Kiro IDE user configuration is missing" };
43
+ const parsed = root(raw, "Kiro IDE user configuration"), servers = parsed.mcpServers === undefined ? {} : object(parsed.mcpServers, "Kiro IDE user mcpServers");
44
+ if (servers.sandbase === undefined)
45
+ return { state: "missing", detail: "SandBase is not registered in Kiro IDE user settings" };
46
+ const id = await identity(env), bridge = expectedBridge || id?.bridge;
47
+ if (!bridge || !owned(servers.sandbase, bridge))
48
+ return { state: "conflict", detail: "the shared sandbase key is not owned by the Kiro IDE client (it may belong to kiro-cli or a third party)" };
49
+ return { state: "configured", detail: "Kiro IDE user MCP ownership is verified; reload the IDE and verify server/tools plus a safe call" };
50
+ }
51
+ catch (error) {
52
+ return { state: "invalid", detail: error instanceof Error ? error.message : "Kiro IDE configuration is invalid" };
53
+ } }
54
+ export async function installKiroIDE(bridge, env = process.env) { if (!isAbsolute(bridge))
55
+ throw new Error("kiro: managed bridge path must be absolute; no changes were made"); const before = await inspectKiroIDE(env, bridge); if (["confirmation_required", "conflict", "invalid"].includes(before.state))
56
+ throw new Error(`kiro: ${before.detail}; no changes were made`); const path = configPath("kiro", env), raw = await readOptional(path), text = raw === undefined || !raw.trim() ? "{}\n" : raw, parsed = root(text, "Kiro IDE user configuration"), servers = parsed.mcpServers === undefined ? {} : object(parsed.mcpServers, "Kiro IDE user mcpServers"), idPath = ownerPath(env), oldIdentity = await readOptional(idPath), nextIdentity = JSON.stringify({ marker, client: "kiro", bridge }, null, 2) + "\n", changed = !owned(servers.sandbase, bridge), identityChanged = oldIdentity !== nextIdentity, result = { path, changed, identityPath: idPath, identityChanged, ...(oldIdentity === undefined ? {} : { identityPrevious: oldIdentity }) }; try {
57
+ if (identityChanged)
58
+ await atomicWrite(idPath, nextIdentity);
59
+ if (changed) {
60
+ servers.sandbase = entry(bridge);
61
+ parsed.mcpServers = servers;
62
+ const saved = await backup(path);
63
+ if (saved !== undefined)
64
+ result.backup = saved;
65
+ await atomicWrite(path, JSON.stringify(parsed, null, 2) + "\n");
66
+ }
67
+ const after = await inspectKiroIDE(env, bridge);
68
+ if (after.state !== "configured")
69
+ throw new Error(`Kiro IDE readback failed: ${after.detail}`);
70
+ return result;
71
+ }
72
+ catch (error) {
73
+ await rollbackKiroIDE(result);
74
+ throw error;
75
+ } }
76
+ export async function rollbackKiroIDE(result) { const work = []; if (result.changed)
77
+ work.push(restore(result.path, result.backup)); if (result.identityChanged)
78
+ work.push(result.identityPrevious === undefined ? rm(result.identityPath, { force: true }) : atomicWrite(result.identityPath, result.identityPrevious)); const settled = await Promise.allSettled(work); if (settled.some(item => item.status === "rejected"))
79
+ throw new Error("Kiro IDE rollback was incomplete"); }
80
+ export async function snapshotKiroIDEUnregister(env = process.env) { const inspection = await inspectKiroIDE(env); if (inspection.state === "missing")
81
+ return undefined; if (inspection.state !== "configured")
82
+ throw new Error(`kiro: ${inspection.detail}; no changes were made`); const [config, identityRaw] = await Promise.all([readOptional(configPath("kiro", env)), readOptional(ownerPath(env))]); if (config === undefined || identityRaw === undefined)
83
+ throw new Error("kiro: managed ownership state is incomplete; no changes were made"); return { path: configPath("kiro", env), config, identityPath: ownerPath(env), identity: identityRaw }; }
84
+ export async function restoreKiroIDEUnregister(snapshot) { await Promise.all([atomicWrite(snapshot.path, snapshot.config), atomicWrite(snapshot.identityPath, snapshot.identity)]); }
85
+ export async function unregisterKiroIDE(env = process.env) { const snapshot = await snapshotKiroIDEUnregister(env); if (!snapshot)
86
+ return false; try {
87
+ const parsed = root(snapshot.config, "Kiro IDE user configuration"), servers = object(parsed.mcpServers, "Kiro IDE user mcpServers");
88
+ delete servers.sandbase;
89
+ parsed.mcpServers = servers;
90
+ await atomicWrite(snapshot.path, JSON.stringify(parsed, null, 2) + "\n");
91
+ await rm(snapshot.identityPath, { force: true });
92
+ const after = await inspectKiroIDE(env);
93
+ if (after.state !== "missing")
94
+ throw new Error(`Kiro IDE removal readback failed: ${after.detail}`);
95
+ return true;
96
+ }
97
+ catch (error) {
98
+ await restoreKiroIDEUnregister(snapshot);
99
+ throw error;
100
+ } }
package/dist/paths.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { homedir } from "node:os";
2
2
  import { join } from "node:path";
3
- export function sandbaseHome(env = process.env) { return env.SANDBASE_HOME || join(homedir(), ".sandbase"); }
3
+ import { existsSync } from "node:fs";
4
+ export function sandbaseHome(env = process.env) { return env.SANDBASE_HOME || join(env.HOME || homedir(), ".sandbase"); }
4
5
  export function configPath(client, env = process.env) {
5
6
  const home = env.HOME || homedir();
6
7
  if (client === "codex")
@@ -11,13 +12,37 @@ export function configPath(client, env = process.env) {
11
12
  return join(home, ".cursor", "mcp.json");
12
13
  if (client === "hermes")
13
14
  return env.HERMES_HOME ? join(env.HERMES_HOME, "config.yaml") : join(home, ".hermes", "config.yaml");
14
- if (client === "claude-desktop")
15
- return env.CLAUDE_DESKTOP_CONFIG || join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json");
16
15
  if (client === "gemini-cli")
17
16
  return join(home, ".gemini", "settings.json");
18
17
  if (client === "qwen-code")
19
18
  return join(home, ".qwen", "settings.json");
19
+ if (client === "opencode") {
20
+ if (env.OPENCODE_CONFIG)
21
+ return env.OPENCODE_CONFIG;
22
+ const json = join(home, ".config", "opencode", "opencode.json");
23
+ const jsonc = join(home, ".config", "opencode", "opencode.jsonc");
24
+ return existsSync(json) || !existsSync(jsonc) ? json : jsonc;
25
+ }
26
+ if (client === "windsurf")
27
+ return join(home, ".codeium", "windsurf", "mcp_config.json");
20
28
  if (client === "cursor-cli")
21
29
  return join(home, ".cursor", "mcp.json");
30
+ if (client === "kimi-cli")
31
+ return join(env.KIMI_SHARE_DIR || join(home, ".kimi"), "mcp.json");
32
+ if (client === "kiro-cli")
33
+ return join(env.KIRO_HOME || join(home, ".kiro"), "settings", "mcp.json");
34
+ if (client === "kiro")
35
+ return join(home, ".kiro", "settings", "mcp.json");
36
+ if (client === "amp") {
37
+ const json = join(home, ".config", "amp", "settings.json");
38
+ const jsonc = join(home, ".config", "amp", "settings.jsonc");
39
+ return existsSync(json) || !existsSync(jsonc) ? json : jsonc;
40
+ }
41
+ if (client === "crush")
42
+ return env.CRUSH_GLOBAL_CONFIG || join(home, ".config", "crush", "crush.json");
43
+ if (client === "iflow-cli")
44
+ return join(home, ".iflow", "settings.json");
45
+ if (client === "warp")
46
+ return join(home, ".warp", ".mcp.json");
22
47
  return join(sandbaseHome(env), "manual", `${client}.json`);
23
48
  }
@@ -0,0 +1,77 @@
1
+ import type { Client } from "./types.js";
2
+ /** Immutable release identity approved for the native Skills CLI adapter. */
3
+ export declare const sandbaseSkillRelease: {
4
+ readonly repository: "https://github.com/sandbaseai/sandbase-skills";
5
+ readonly release: "v0.1.0";
6
+ readonly sourceArg: "https://github.com/sandbaseai/sandbase-skills/tree/v0.1.0";
7
+ readonly commit: "03bc2811987db610cd64cbddfaa79b08e46c0e2f";
8
+ readonly skillSha256: "583879aa39368577ebadd270434923969cbdeac0e0be73f5db0c2494019418da";
9
+ readonly minimumCliVersion: "1.5.20";
10
+ };
11
+ export interface SkillsAgentRegistration {
12
+ skillsAgentId: string;
13
+ }
14
+ /** Only IDs verified by the release owner may be passed to the Skills CLI. */
15
+ export declare const skillsAgentRegistry: Partial<Record<Client, SkillsAgentRegistration>>;
16
+ export type NativeSkillStatus = "installed" | "already_installed" | "removed" | "confirmation_required" | "failed";
17
+ export type NativeSkillFailure = "skill_source_unavailable" | "skills_cli_unavailable" | "unsupported_by_skills_cli" | "readback_failed";
18
+ export interface NativeSkillResult {
19
+ status: NativeSkillStatus;
20
+ code?: NativeSkillFailure;
21
+ message: string;
22
+ }
23
+ export interface NativeSkillRemovalPlan {
24
+ agent?: string;
25
+ owned: boolean;
26
+ result: NativeSkillResult;
27
+ }
28
+ export interface SkillsCommandResult {
29
+ code: number | null;
30
+ stdout: string;
31
+ stderr: string;
32
+ }
33
+ export type SkillsCommandRunner = (args: readonly string[]) => Promise<SkillsCommandResult>;
34
+ export type SkillsReadbackVerifier = (json: string, agent: string) => Promise<boolean>;
35
+ /** Immutable public identity of the ClawHub Skill adapter. */
36
+ export declare const openClawSandbaseSkill: {
37
+ readonly slug: "@joeliu926/sandbase";
38
+ readonly name: "sandbase";
39
+ readonly page: "https://clawhub.ai/joeliu926/skills/sandbase";
40
+ };
41
+ export type OpenClawCommandRunner = (args: readonly string[]) => Promise<SkillsCommandResult>;
42
+ export type OpenClawReadbackVerifier = (json: string) => Promise<boolean>;
43
+ export type OpenClawMcpStatus = "configured" | "already_configured" | "missing" | "confirmation_required" | "failed" | "removed";
44
+ export interface OpenClawMcpResult {
45
+ status: OpenClawMcpStatus;
46
+ message: string;
47
+ }
48
+ export declare const systemOpenClawRunner: OpenClawCommandRunner;
49
+ /**
50
+ * OpenClaw's documented JSON readback reports an installed workspace Skill's
51
+ * name, loader source, and frontmatter homepage. Those three values are the
52
+ * only supported evidence used here; paths and raw SKILL.md contents are not
53
+ * considered ownership proof.
54
+ */
55
+ export declare const verifyOpenClawSandbaseReadback: OpenClawReadbackVerifier;
56
+ /** Read only the managed OpenClaw MCP entry; malformed or foreign entries fail closed. */
57
+ export declare function inspectOpenClawMcp(runner?: OpenClawCommandRunner): Promise<OpenClawMcpResult>;
58
+ /**
59
+ * Configure the documented OpenClaw MCP registry. The credential deliberately
60
+ * remains in SandBase's restricted local store and is never included in this
61
+ * JSON value or passed to OpenClaw.
62
+ */
63
+ export declare function installOpenClawMcp(bridgePath: string, runner?: OpenClawCommandRunner): Promise<OpenClawMcpResult>;
64
+ /** Remove only the exact managed entry, then prove that it is absent. */
65
+ export declare function removeOpenClawMcp(runner?: OpenClawCommandRunner): Promise<OpenClawMcpResult>;
66
+ export declare function installOpenClawSkill(runner?: OpenClawCommandRunner, verify?: OpenClawReadbackVerifier): Promise<NativeSkillResult>;
67
+ export declare function inspectOpenClawSkill(runner?: OpenClawCommandRunner, verify?: OpenClawReadbackVerifier): Promise<NativeSkillResult>;
68
+ export declare function removeOpenClawSkill(runner?: OpenClawCommandRunner, verify?: OpenClawReadbackVerifier): Promise<NativeSkillResult>;
69
+ /** Reject every mutable or incomplete source tuple before starting any child process. */
70
+ export declare function validateSandbaseSkillRelease(release?: typeof sandbaseSkillRelease): boolean;
71
+ export declare const systemSkillsRunner: SkillsCommandRunner;
72
+ export declare const verifySkillsReadback: SkillsReadbackVerifier;
73
+ export declare function installNativeSkill(client: Client, runner?: SkillsCommandRunner, verify?: SkillsReadbackVerifier): Promise<NativeSkillResult>;
74
+ export declare function inspectNativeSkill(client: Client, runner?: SkillsCommandRunner, verify?: SkillsReadbackVerifier): Promise<NativeSkillResult>;
75
+ export declare function planNativeSkillRemoval(client: Client, runner?: SkillsCommandRunner, verify?: SkillsReadbackVerifier): Promise<NativeSkillRemovalPlan>;
76
+ export declare function executeNativeSkillRemoval(plan: NativeSkillRemovalPlan, runner?: SkillsCommandRunner, verify?: SkillsReadbackVerifier): Promise<NativeSkillResult>;
77
+ export declare function removeNativeSkill(client: Client, runner?: SkillsCommandRunner, verify?: SkillsReadbackVerifier): Promise<NativeSkillResult>;