sfora-cli 0.14.0 → 0.15.0
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 +67 -0
- package/dist/SforaFs.js +68 -0
- package/dist/api-client.d.ts +23 -0
- package/dist/api-client.js +29 -3
- package/dist/block-commands.d.ts +1 -0
- package/dist/block-commands.js +1 -0
- package/dist/cli-args.d.ts +4 -0
- package/dist/cli-args.js +8 -0
- package/dist/cli.js +39 -33
- package/dist/config.d.ts +2 -0
- package/dist/config.js +15 -6
- package/dist/format/cardMarkdown.d.ts +1 -0
- package/dist/format/cardMarkdown.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/local/workspace.d.ts +0 -16
- package/dist/local/workspace.js +34 -28
- package/dist/local-core/files.d.ts +23 -0
- package/dist/local-core/files.js +110 -0
- package/dist/local-core/index.d.ts +4 -0
- package/dist/local-core/index.js +4 -0
- package/dist/local-core/skills.d.ts +45 -0
- package/dist/local-core/skills.js +239 -0
- package/dist/skills-client.d.ts +21 -0
- package/dist/skills-client.js +36 -0
- package/dist/skills-command.d.ts +4 -0
- package/dist/skills-command.js +75 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/package.json +20 -2
- package/dist/config.test.d.ts +0 -1
- package/dist/config.test.js +0 -94
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLI_VERSION = "0.15.0";
|
package/dist/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sfora-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Your sfora workspace as a markdown filesystem
|
|
5
|
+
"description": "Your sfora workspace as a markdown filesystem \u2014 a CLI + MCP server. Post/task/doc, ls/cat/grep, and a shell so agents operate sfora natively.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"sfora",
|
|
8
8
|
"mcp",
|
|
@@ -52,5 +52,23 @@
|
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=20"
|
|
55
|
+
},
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"import": "./dist/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./local-core": {
|
|
62
|
+
"types": "./dist/local-core/index.d.ts",
|
|
63
|
+
"import": "./dist/local-core/index.js"
|
|
64
|
+
},
|
|
65
|
+
"./config": {
|
|
66
|
+
"types": "./dist/config.d.ts",
|
|
67
|
+
"import": "./dist/config.js"
|
|
68
|
+
},
|
|
69
|
+
"./skills-client": {
|
|
70
|
+
"types": "./dist/skills-client.d.ts",
|
|
71
|
+
"import": "./dist/skills-client.js"
|
|
72
|
+
}
|
|
55
73
|
}
|
|
56
74
|
}
|
package/dist/config.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/config.test.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
-
import { resolveSettings, upsertProfile, effectiveProfiles, profileKey, DEFAULT_URL, } from "./config.js";
|
|
3
|
-
const DEV_URL = "https://valuable-llama-777.eu-west-1.convex.site";
|
|
4
|
-
// resolveSettings reads SFORA_* env as a fallback — clear them so tests assert
|
|
5
|
-
// the config/flag behavior in isolation.
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
delete process.env.SFORA_URL;
|
|
8
|
-
delete process.env.SFORA_ORG;
|
|
9
|
-
delete process.env.SFORA_API_KEY;
|
|
10
|
-
});
|
|
11
|
-
describe("legacy migration", () => {
|
|
12
|
-
it("folds a legacy top-level identity into a profile", () => {
|
|
13
|
-
const cfg = {
|
|
14
|
-
url: DEFAULT_URL,
|
|
15
|
-
org: "wavyr",
|
|
16
|
-
apiKey: "sfora_ak_prod",
|
|
17
|
-
};
|
|
18
|
-
const profiles = effectiveProfiles(cfg);
|
|
19
|
-
expect(profiles[profileKey(DEFAULT_URL, "wavyr")]).toEqual({
|
|
20
|
-
url: DEFAULT_URL,
|
|
21
|
-
org: "wavyr",
|
|
22
|
-
apiKey: "sfora_ak_prod",
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
it("resolves the sole legacy identity with no flags", () => {
|
|
26
|
-
const cfg = {
|
|
27
|
-
url: DEFAULT_URL,
|
|
28
|
-
org: "wavyr",
|
|
29
|
-
apiKey: "sfora_ak_prod",
|
|
30
|
-
};
|
|
31
|
-
expect(resolveSettings({}, cfg)).toEqual({
|
|
32
|
-
url: DEFAULT_URL,
|
|
33
|
-
org: "wavyr",
|
|
34
|
-
apiKey: "sfora_ak_prod",
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe("no cross-deployment key reuse", () => {
|
|
39
|
-
it("does NOT send the prod key to an unmatched dev target", () => {
|
|
40
|
-
const cfg = {
|
|
41
|
-
url: DEFAULT_URL,
|
|
42
|
-
org: "wavyr",
|
|
43
|
-
apiKey: "sfora_ak_prod",
|
|
44
|
-
};
|
|
45
|
-
const r = resolveSettings({ url: DEV_URL, org: "test" }, cfg);
|
|
46
|
-
expect(r.url).toBe(DEV_URL);
|
|
47
|
-
expect(r.org).toBe("test");
|
|
48
|
-
// The whole point: no key rather than the wrong key.
|
|
49
|
-
expect(r.apiKey).toBeUndefined();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
describe("profiles coexist (the fix)", () => {
|
|
53
|
-
it("login to dev does not clobber the prod key; each resolves by intent", () => {
|
|
54
|
-
let cfg = {
|
|
55
|
-
url: DEFAULT_URL,
|
|
56
|
-
org: "wavyr",
|
|
57
|
-
apiKey: "sfora_ak_prod",
|
|
58
|
-
};
|
|
59
|
-
// Simulate `sfora login` against dev.
|
|
60
|
-
cfg = upsertProfile(cfg, {
|
|
61
|
-
url: DEV_URL,
|
|
62
|
-
org: "test",
|
|
63
|
-
apiKey: "sfora_ak_dev",
|
|
64
|
-
}).cfg;
|
|
65
|
-
// Both keys are retained.
|
|
66
|
-
const profiles = effectiveProfiles(cfg);
|
|
67
|
-
expect(Object.keys(profiles)).toHaveLength(2);
|
|
68
|
-
// Prod still reachable by intent.
|
|
69
|
-
expect(resolveSettings({ org: "wavyr" }, cfg).apiKey).toBe("sfora_ak_prod");
|
|
70
|
-
expect(resolveSettings({ url: DEFAULT_URL }, cfg).apiKey).toBe("sfora_ak_prod");
|
|
71
|
-
// Dev reachable by intent.
|
|
72
|
-
expect(resolveSettings({ org: "test" }, cfg).apiKey).toBe("sfora_ak_dev");
|
|
73
|
-
// No intent → the last login (active profile) wins.
|
|
74
|
-
expect(resolveSettings({}, cfg)).toEqual({
|
|
75
|
-
url: DEV_URL,
|
|
76
|
-
org: "test",
|
|
77
|
-
apiKey: "sfora_ak_dev",
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
describe("bot identity", () => {
|
|
82
|
-
it("uses the named bot's key and never the personal fallback", () => {
|
|
83
|
-
const cfg = {
|
|
84
|
-
url: DEFAULT_URL,
|
|
85
|
-
org: "wavyr",
|
|
86
|
-
apiKey: "sfora_ak_prod",
|
|
87
|
-
bots: { ci: { apiKey: "sfora_ak_ci", org: "wavyr" } },
|
|
88
|
-
};
|
|
89
|
-
const r = resolveSettings({ bot: "ci" }, cfg);
|
|
90
|
-
expect(r.apiKey).toBe("sfora_ak_ci");
|
|
91
|
-
const missing = resolveSettings({ bot: "nope" }, cfg);
|
|
92
|
-
expect(missing.apiKey).toBeUndefined();
|
|
93
|
-
});
|
|
94
|
-
});
|