@groundnuty/macf 0.2.11 → 0.2.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/dist/.build-info.json +2 -2
- package/dist/cli/claude-sh.d.ts.map +1 -1
- package/dist/cli/claude-sh.js +139 -33
- package/dist/cli/claude-sh.js.map +1 -1
- package/dist/cli/commands/init.d.ts +36 -3
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +190 -10
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/migrate.d.ts +44 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +119 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/config.d.ts +10 -2
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +16 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/index.js +21 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/registry-helper.d.ts.map +1 -1
- package/dist/cli/registry-helper.js +8 -0
- package/dist/cli/registry-helper.js.map +1 -1
- package/dist/plugin/bin/macf-plugin-cli.js +16 -24
- package/dist/plugin/bin/macf-plugin-cli.js.map +1 -1
- package/dist/plugin/lib/build-dashboard-health.d.ts +23 -0
- package/dist/plugin/lib/build-dashboard-health.d.ts.map +1 -0
- package/dist/plugin/lib/build-dashboard-health.js +23 -0
- package/dist/plugin/lib/build-dashboard-health.js.map +1 -0
- package/dist/plugin/lib/index.d.ts +3 -0
- package/dist/plugin/lib/index.d.ts.map +1 -1
- package/dist/plugin/lib/index.js +3 -0
- package/dist/plugin/lib/index.js.map +1 -1
- package/dist/plugin/lib/probe-peer-health.d.ts +20 -0
- package/dist/plugin/lib/probe-peer-health.d.ts.map +1 -0
- package/dist/plugin/lib/probe-peer-health.js +40 -0
- package/dist/plugin/lib/probe-peer-health.js.map +1 -0
- package/dist/plugin/lib/registry-config.d.ts +30 -0
- package/dist/plugin/lib/registry-config.d.ts.map +1 -0
- package/dist/plugin/lib/registry-config.js +52 -0
- package/dist/plugin/lib/registry-config.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PeerEntry } from './registry.js';
|
|
2
|
+
import type { HealthResponse } from '@groundnuty/macf-core';
|
|
3
|
+
/**
|
|
4
|
+
* Probe a peer's `/health` endpoint over mTLS using the cert paths set by
|
|
5
|
+
* `claude.sh` (MACF_CA_CERT / MACF_AGENT_CERT / MACF_AGENT_KEY env vars).
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` when env vars are missing or CA-cert read fails — caller's
|
|
8
|
+
* UI layer renders that as "offline" (matches `formatPeerTable` behaviour).
|
|
9
|
+
*
|
|
10
|
+
* Used by the `peers` and `status` cases in `macf-plugin-cli.ts`. The `ping`
|
|
11
|
+
* case keeps its own inline copy because it has a different UX contract:
|
|
12
|
+
* operator-invoked `/macf-ping` should fail loudly when env is incomplete,
|
|
13
|
+
* not silently render "offline".
|
|
14
|
+
*
|
|
15
|
+
* Surfaced by macf#325 — `peers` case was previously a stub mapping every
|
|
16
|
+
* peer to `health: null`, producing misleading "all offline" output even
|
|
17
|
+
* when channel-servers were running. This helper is the structural fix.
|
|
18
|
+
*/
|
|
19
|
+
export declare function probePeerHealth(peer: PeerEntry): Promise<HealthResponse | null>;
|
|
20
|
+
//# sourceMappingURL=probe-peer-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-peer-health.d.ts","sourceRoot":"","sources":["../../../src/plugin/lib/probe-peer-health.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkBrF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { pingAgent } from './health.js';
|
|
3
|
+
/**
|
|
4
|
+
* Probe a peer's `/health` endpoint over mTLS using the cert paths set by
|
|
5
|
+
* `claude.sh` (MACF_CA_CERT / MACF_AGENT_CERT / MACF_AGENT_KEY env vars).
|
|
6
|
+
*
|
|
7
|
+
* Returns `null` when env vars are missing or CA-cert read fails — caller's
|
|
8
|
+
* UI layer renders that as "offline" (matches `formatPeerTable` behaviour).
|
|
9
|
+
*
|
|
10
|
+
* Used by the `peers` and `status` cases in `macf-plugin-cli.ts`. The `ping`
|
|
11
|
+
* case keeps its own inline copy because it has a different UX contract:
|
|
12
|
+
* operator-invoked `/macf-ping` should fail loudly when env is incomplete,
|
|
13
|
+
* not silently render "offline".
|
|
14
|
+
*
|
|
15
|
+
* Surfaced by macf#325 — `peers` case was previously a stub mapping every
|
|
16
|
+
* peer to `health: null`, producing misleading "all offline" output even
|
|
17
|
+
* when channel-servers were running. This helper is the structural fix.
|
|
18
|
+
*/
|
|
19
|
+
export async function probePeerHealth(peer) {
|
|
20
|
+
const caCertPath = process.env['MACF_CA_CERT'];
|
|
21
|
+
const agentCertPath = process.env['MACF_AGENT_CERT'];
|
|
22
|
+
const agentKeyPath = process.env['MACF_AGENT_KEY'];
|
|
23
|
+
if (!caCertPath || !agentCertPath || !agentKeyPath)
|
|
24
|
+
return null;
|
|
25
|
+
let caCertPem;
|
|
26
|
+
try {
|
|
27
|
+
caCertPem = readFileSync(caCertPath, 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return await pingAgent({
|
|
33
|
+
host: peer.info.host,
|
|
34
|
+
port: peer.info.port,
|
|
35
|
+
caCertPem,
|
|
36
|
+
certPath: agentCertPath,
|
|
37
|
+
keyPath: agentKeyPath,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=probe-peer-health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe-peer-health.js","sourceRoot":"","sources":["../../../src/plugin/lib/probe-peer-health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAe;IACnD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACnD,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAChE,IAAI,SAAiB,CAAC;IACtB,IAAI,CAAC;QACH,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,SAAS,CAAC;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QACpB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;QACpB,SAAS;QACT,QAAQ,EAAE,aAAa;QACvB,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RegistryConfig } from '@groundnuty/macf-core';
|
|
2
|
+
/**
|
|
3
|
+
* Build a `RegistryConfig` from `claude.sh`-exported env vars.
|
|
4
|
+
*
|
|
5
|
+
* Env-var → variant mapping (matches `claude.sh` template's
|
|
6
|
+
* `registryEnvLines()` for each registry type):
|
|
7
|
+
*
|
|
8
|
+
* - `MACF_REGISTRY_TYPE=local` + `MACF_REGISTRY_PATH=<abs-path>` — DR-024
|
|
9
|
+
* local mode (sister to DR-010). Path is required when type is `local`;
|
|
10
|
+
* throws with a fix-it diagnostic if missing.
|
|
11
|
+
* - `MACF_REGISTRY_REPO=<owner>/<repo>` — repo-scoped GitHub Variables.
|
|
12
|
+
* - `MACF_REGISTRY_ORG=<org>` — org-scoped GitHub Variables.
|
|
13
|
+
* - `MACF_REGISTRY_USER=<user>` — profile-scoped GitHub Variables.
|
|
14
|
+
*
|
|
15
|
+
* Default fallback: `groundnuty/macf` repo (preserves pre-DR-024 behaviour
|
|
16
|
+
* for plugin invocations outside a launched workspace, e.g. one-off CLI
|
|
17
|
+
* use against the framework repo).
|
|
18
|
+
*
|
|
19
|
+
* Local mode wins over repo/org/profile env vars when both are set —
|
|
20
|
+
* `MACF_REGISTRY_TYPE` is the explicit signal claude.sh exports for
|
|
21
|
+
* mode selection.
|
|
22
|
+
*
|
|
23
|
+
* Surfaced by macf#332 — pre-fix, the function ignored
|
|
24
|
+
* `MACF_REGISTRY_TYPE=local` entirely and fell through to the default
|
|
25
|
+
* fallback, so `/macf-peers` etc. dispatched to a GitHub registry path
|
|
26
|
+
* that then required App-cred env vars. Critical regression for v0.2.12
|
|
27
|
+
* local-mode consumers.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getRegistryConfig(env?: NodeJS.ProcessEnv): RegistryConfig;
|
|
30
|
+
//# sourceMappingURL=registry-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-config.d.ts","sourceRoot":"","sources":["../../../src/plugin/lib/registry-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,cAAc,CAuBtF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a `RegistryConfig` from `claude.sh`-exported env vars.
|
|
3
|
+
*
|
|
4
|
+
* Env-var → variant mapping (matches `claude.sh` template's
|
|
5
|
+
* `registryEnvLines()` for each registry type):
|
|
6
|
+
*
|
|
7
|
+
* - `MACF_REGISTRY_TYPE=local` + `MACF_REGISTRY_PATH=<abs-path>` — DR-024
|
|
8
|
+
* local mode (sister to DR-010). Path is required when type is `local`;
|
|
9
|
+
* throws with a fix-it diagnostic if missing.
|
|
10
|
+
* - `MACF_REGISTRY_REPO=<owner>/<repo>` — repo-scoped GitHub Variables.
|
|
11
|
+
* - `MACF_REGISTRY_ORG=<org>` — org-scoped GitHub Variables.
|
|
12
|
+
* - `MACF_REGISTRY_USER=<user>` — profile-scoped GitHub Variables.
|
|
13
|
+
*
|
|
14
|
+
* Default fallback: `groundnuty/macf` repo (preserves pre-DR-024 behaviour
|
|
15
|
+
* for plugin invocations outside a launched workspace, e.g. one-off CLI
|
|
16
|
+
* use against the framework repo).
|
|
17
|
+
*
|
|
18
|
+
* Local mode wins over repo/org/profile env vars when both are set —
|
|
19
|
+
* `MACF_REGISTRY_TYPE` is the explicit signal claude.sh exports for
|
|
20
|
+
* mode selection.
|
|
21
|
+
*
|
|
22
|
+
* Surfaced by macf#332 — pre-fix, the function ignored
|
|
23
|
+
* `MACF_REGISTRY_TYPE=local` entirely and fell through to the default
|
|
24
|
+
* fallback, so `/macf-peers` etc. dispatched to a GitHub registry path
|
|
25
|
+
* that then required App-cred env vars. Critical regression for v0.2.12
|
|
26
|
+
* local-mode consumers.
|
|
27
|
+
*/
|
|
28
|
+
export function getRegistryConfig(env = process.env) {
|
|
29
|
+
if (env['MACF_REGISTRY_TYPE'] === 'local') {
|
|
30
|
+
const path = env['MACF_REGISTRY_PATH'];
|
|
31
|
+
if (!path) {
|
|
32
|
+
throw new Error('MACF_REGISTRY_TYPE=local but MACF_REGISTRY_PATH is not set. ' +
|
|
33
|
+
'Run `macf init --local` to regenerate claude.sh, or set MACF_REGISTRY_PATH manually.');
|
|
34
|
+
}
|
|
35
|
+
return { type: 'local', path };
|
|
36
|
+
}
|
|
37
|
+
const repoEnv = env['MACF_REGISTRY_REPO'];
|
|
38
|
+
if (repoEnv) {
|
|
39
|
+
const parts = repoEnv.split('/');
|
|
40
|
+
if (parts.length === 2 && parts[0] && parts[1]) {
|
|
41
|
+
return { type: 'repo', owner: parts[0], repo: parts[1] };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const orgEnv = env['MACF_REGISTRY_ORG'];
|
|
45
|
+
if (orgEnv)
|
|
46
|
+
return { type: 'org', org: orgEnv };
|
|
47
|
+
const userEnv = env['MACF_REGISTRY_USER'];
|
|
48
|
+
if (userEnv)
|
|
49
|
+
return { type: 'profile', user: userEnv };
|
|
50
|
+
return { type: 'repo', owner: 'groundnuty', repo: 'macf' };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=registry-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-config.js","sourceRoot":"","sources":["../../../src/plugin/lib/registry-config.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACpE,IAAI,GAAG,CAAC,oBAAoB,CAAC,KAAK,OAAO,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,GAAG,CAAC,oBAAoB,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,8DAA8D;gBAC9D,sFAAsF,CACvF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1C,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxC,IAAI,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1C,IAAI,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACvD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groundnuty/macf",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Multi-Agent Coordination Framework CLI — coordinate Claude Code agents via GitHub. Installs as `macf` binary; use `macf init` to set up an agent workspace, `macf update` to refresh rules + version pins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test:watch": "vitest"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@groundnuty/macf-core": "0.2.
|
|
38
|
+
"@groundnuty/macf-core": "0.2.13",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"reflect-metadata": "^0.2.2",
|
|
41
41
|
"zod": "^4.0.0"
|