@mmerterden/multi-agent-pipeline 23.7.0 → 24.1.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/CHANGELOG.md +60 -1
- package/README.md +59 -24
- package/README.tr.md +43 -8
- package/SECURITY.md +3 -3
- package/docs/architecture.md +41 -4
- package/docs/ecosystem.md +15 -13
- package/docs/facts.json +5 -4
- package/docs/features.md +67 -15
- package/install/_codex-agents.mjs +13 -8
- package/install/_common.mjs +24 -0
- package/install/_dev-only-files.mjs +5 -0
- package/install/_mcp-register.mjs +6 -2
- package/install/_rewrite-tree.mjs +197 -0
- package/install/codex.mjs +96 -180
- package/install/copilot.mjs +24 -54
- package/install/index.mjs +29 -11
- package/install/templates/codex-instructions.md +21 -5
- package/install/templates/copilot-instructions.md +21 -14
- package/manifest.json +2083 -0
- package/package.json +8 -2
- package/pipeline/commands/multi-agent/SKILL.md +5 -4
- package/pipeline/commands/multi-agent/analysis/SKILL.md +5 -1
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +31 -3
- package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +5 -1
- package/pipeline/commands/multi-agent/channels/SKILL.md +16 -8
- package/pipeline/commands/multi-agent/log/SKILL.md +2 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +1 -1
- package/pipeline/contract/CHANGELOG.md +15 -0
- package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
- package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
- package/pipeline/contract/fixtures/runs-awaiting-question.json +6 -1
- package/pipeline/contract/fixtures/runs-empty.json +1 -1
- package/pipeline/contract/fixtures/runs-failed.json +21 -1
- package/pipeline/contract/fixtures/runs-old-schema.json +18 -3
- package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +31 -1
- package/pipeline/contract/fixtures/runs-pr-opened.json +31 -1
- package/pipeline/contract/fixtures/runs-running.json +16 -1
- package/pipeline/contract/manifest.json +14 -14
- package/pipeline/contract/types/index.d.ts +20 -1
- package/pipeline/lib/_jira-auth.sh +50 -78
- package/pipeline/lib/_service-account.sh +191 -0
- package/pipeline/lib/credential-inventory.sh +49 -37
- package/pipeline/lib/credential-store.sh +48 -3
- package/pipeline/lib/fetch-confluence.sh +76 -92
- package/pipeline/lib/fetch-crashlytics.sh +30 -59
- package/pipeline/lib/fetch-figma-annotations.sh +9 -9
- package/pipeline/lib/fetch-fortify.sh +77 -81
- package/pipeline/lib/fetch-graylog.sh +38 -77
- package/pipeline/lib/figma-mcp-refresh.sh +23 -4
- package/pipeline/lib/figma-screenshot.sh +7 -8
- package/pipeline/lib/figma-token.sh +39 -46
- package/pipeline/lib/host.mjs +138 -0
- package/pipeline/lib/host.sh +48 -0
- package/pipeline/lib/issue-fetcher.sh +25 -41
- package/pipeline/lib/jira-publish.sh +23 -21
- package/pipeline/lib/local-model.mjs +93 -0
- package/pipeline/lib/md2confluence-v3.py +37 -30
- package/pipeline/lib/model-dispatch.sh +41 -4
- package/pipeline/lib/model-resolve.mjs +58 -0
- package/pipeline/lib/post-pr-review.sh +38 -53
- package/pipeline/lib/reviewer-families.mjs +70 -0
- package/pipeline/lib/service-account.mjs +2131 -0
- package/pipeline/lib/service-account.sh +35 -0
- package/pipeline/lib/usage-token.mjs +64 -24
- package/pipeline/lib/usage-vocab.mjs +1 -1
- package/pipeline/lib/user-facing.mjs +11 -3
- package/pipeline/lib/vercel-deploy.sh +17 -26
- package/pipeline/multi-agent-refs/_entry-picker.md +62 -0
- package/pipeline/multi-agent-refs/analysis/intake.md +2 -0
- package/pipeline/multi-agent-refs/analysis/render.md +12 -1
- package/pipeline/multi-agent-refs/analysis/reusable-refs.md +1 -0
- package/pipeline/multi-agent-refs/analysis/unattended.md +135 -0
- package/pipeline/multi-agent-refs/autopilot-on/details.md +16 -0
- package/pipeline/multi-agent-refs/channels/generator.md +10 -2
- package/pipeline/multi-agent-refs/channels/menu.md +3 -1
- package/pipeline/multi-agent-refs/channels/preview.md +3 -1
- package/pipeline/multi-agent-refs/channels/reference.md +16 -2
- package/pipeline/multi-agent-refs/channels/report-file.md +188 -0
- package/pipeline/multi-agent-refs/cross-cli-contract.md +35 -27
- package/pipeline/multi-agent-refs/features/doctor.md +37 -11
- package/pipeline/multi-agent-refs/features/free-models.md +3 -3
- package/pipeline/multi-agent-refs/features/local-model.md +87 -0
- package/pipeline/multi-agent-refs/features/model-fallback.md +25 -10
- package/pipeline/multi-agent-refs/features/product-context.md +6 -5
- package/pipeline/multi-agent-refs/features/service-accounts.md +233 -0
- package/pipeline/multi-agent-refs/features/unattended-security.md +10 -1
- package/pipeline/multi-agent-refs/help/en.md +36 -1
- package/pipeline/multi-agent-refs/help/tr.md +34 -1
- package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +2 -1
- package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -1
- package/pipeline/multi-agent-refs/phases/modes.md +20 -1
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -0
- package/pipeline/multi-agent-refs/phases/phase-4-commit.md +1 -0
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +13 -11
- package/pipeline/multi-agent-refs/phases.md +4 -3
- package/pipeline/multi-agent-refs/review/panel.md +30 -18
- package/pipeline/multi-agent-refs/setup/discovery.md +17 -5
- package/pipeline/multi-agent-refs/setup/token-save-flow.md +21 -2
- package/pipeline/multi-agent-refs/sync/overview.md +11 -5
- package/pipeline/multi-agent-refs/tracker-contract.md +64 -20
- package/pipeline/office/index.html +77 -4
- package/pipeline/schemas/activity.schema.json +63 -4
- package/pipeline/schemas/autopilot-config.schema.json +29 -4
- package/pipeline/schemas/hosts.json +512 -0
- package/pipeline/schemas/hosts.schema.json +310 -0
- package/pipeline/schemas/launch.json +22 -2
- package/pipeline/schemas/launch.schema.json +2 -1
- package/pipeline/schemas/now-lines.json +103 -0
- package/pipeline/schemas/now-lines.schema.json +42 -0
- package/pipeline/schemas/phases.json +19 -1
- package/pipeline/schemas/phases.schema.json +8 -0
- package/pipeline/schemas/prefs.schema.json +331 -4
- package/pipeline/schemas/runs-index.schema.json +22 -1
- package/pipeline/scripts/_autopilot-config.mjs +67 -4
- package/pipeline/scripts/_autopilot-item.mjs +67 -0
- package/pipeline/scripts/_autopilot-outcomes.mjs +6 -0
- package/pipeline/scripts/_contract-core.mjs +1 -1
- package/pipeline/scripts/_cost.mjs +75 -3
- package/pipeline/scripts/activity-snapshot.mjs +27 -1
- package/pipeline/scripts/analysis-sources.mjs +22 -5
- package/pipeline/scripts/analysis-unattended.mjs +360 -0
- package/pipeline/scripts/anonymize-findings.mjs +3 -7
- package/pipeline/scripts/autopilot-arming.mjs +19 -10
- package/pipeline/scripts/autopilot-intake.mjs +124 -27
- package/pipeline/scripts/autopilot-menubar.swift +7 -0
- package/pipeline/scripts/autopilot-runner.mjs +77 -48
- package/pipeline/scripts/autopilot-status.sh +32 -9
- package/pipeline/scripts/bulk-read.sh +37 -5
- package/pipeline/scripts/confluence-readback.mjs +15 -7
- package/pipeline/scripts/cost-table.json +65 -25
- package/pipeline/scripts/doctor.mjs +119 -32
- package/pipeline/scripts/entry-mode.mjs +101 -0
- package/pipeline/scripts/estimate.mjs +30 -16
- package/pipeline/scripts/feedback-send.mjs +11 -8
- package/pipeline/scripts/gen-facts.mjs +7 -9
- package/pipeline/scripts/jira-attach.sh +23 -28
- package/pipeline/scripts/jira-search.sh +5 -21
- package/pipeline/scripts/launch-request.mjs +15 -9
- package/pipeline/scripts/migrate-prefs.mjs +56 -0
- package/pipeline/scripts/phase-tracker.sh +226 -50
- package/pipeline/scripts/priority-review.mjs +14 -7
- package/pipeline/scripts/product-context.mjs +26 -7
- package/pipeline/scripts/prune-logs.sh +4 -2
- package/pipeline/scripts/render-work-summary.sh +51 -1
- package/pipeline/scripts/report-file.mjs +285 -0
- package/pipeline/scripts/rework-escalation.mjs +19 -4
- package/pipeline/scripts/runs-index.mjs +2 -1
- package/pipeline/scripts/service-read.mjs +19 -17
- package/pipeline/scripts/skill-siblings.mjs +17 -1
- package/pipeline/scripts/status-overview.mjs +20 -10
- package/pipeline/scripts/uninstall.mjs +145 -57
- package/pipeline/scripts/usage-register.mjs +34 -11
- package/pipeline/scripts/usage-report.mjs +31 -26
- package/pipeline/scripts/validate-triage.mjs +11 -1
- package/pipeline/scripts/work-items.mjs +25 -28
- package/pipeline/scripts/write-store-config.mjs +37 -11
- package/pipeline/skills/.skill-manifest.json +4 -4
- package/pipeline/skills/.skills-index.json +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +11 -3
- package/pipeline/skills/shared/core/multi-agent-analysis/SKILL.md +2 -0
- package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +11 -8
- package/pipeline/lib/credential-resolve.mjs +0 -75
|
@@ -70,10 +70,13 @@ import { prefsHosts, profileGaps } from "../lib/unattended-profile-check.mjs";
|
|
|
70
70
|
import { xcodeSkillsStatus } from "../lib/xcode-plugin.mjs";
|
|
71
71
|
import { hookReport, registrationGaps } from "../lib/hook-registration.mjs";
|
|
72
72
|
import { PREFS_ENV, globalPref, prefsFileIn } from "../lib/prefs-value.mjs";
|
|
73
|
+
import { itemNames } from "../lib/service-account.mjs";
|
|
73
74
|
import { check as lowDiskCheck } from "../lib/low-disk.mjs";
|
|
74
75
|
import { exitOnHelp } from "../lib/cli-help.mjs";
|
|
75
76
|
import { LEGACY_SERVER_ID, MCP_SERVER_ID, projectLegacyEntries } from "../lib/mcp-rename.mjs";
|
|
76
77
|
import { didYouMean } from "../lib/args.mjs";
|
|
78
|
+
import { HOST_IDS, STATE_ROOT, currentHostId, host } from "../lib/host.mjs";
|
|
79
|
+
import { localModelProblem } from "../lib/local-model.mjs";
|
|
77
80
|
import { reportingState } from "./usage-register.mjs";
|
|
78
81
|
import { accessDoctorLine, readAccessState } from "./usage-access.mjs";
|
|
79
82
|
import { familyLine, loadFromManifest, schemaLoadByFamily } from "../lib/mcp-schema-load.mjs";
|
|
@@ -82,7 +85,16 @@ exitOnHelp(import.meta.url);
|
|
|
82
85
|
|
|
83
86
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
84
87
|
const HOME = homedir();
|
|
85
|
-
|
|
88
|
+
// Shared state: logs, preferences, knowledge and the Claude Code settings file
|
|
89
|
+
// live here whichever hosts are installed.
|
|
90
|
+
const CLAUDE = join(HOME, STATE_ROOT);
|
|
91
|
+
// The install this doctor is part of. Running from a checkout there is no
|
|
92
|
+
// install to read, so the checks that need one answer about the first host.
|
|
93
|
+
// Reading `.claude` on a Copilot-only machine reported "no install" on a
|
|
94
|
+
// machine with a complete one.
|
|
95
|
+
const HOST_ID = currentHostId(HERE) ?? HOST_IDS[0];
|
|
96
|
+
const HOST = host(HOST_ID);
|
|
97
|
+
const HOST_TREE = currentHostId(HERE) ? dirname(HERE) : join(HOME, HOST.install.root);
|
|
86
98
|
const PREFS = prefsFileIn(HOME);
|
|
87
99
|
|
|
88
100
|
const argv = process.argv.slice(2);
|
|
@@ -146,6 +158,7 @@ const CHECK_IDS = [
|
|
|
146
158
|
"usage-register",
|
|
147
159
|
"access",
|
|
148
160
|
"free-models",
|
|
161
|
+
"local-model",
|
|
149
162
|
"xcode-skills",
|
|
150
163
|
"routine-commands",
|
|
151
164
|
"mcp-legacy-names",
|
|
@@ -225,7 +238,7 @@ function readJson(path) {
|
|
|
225
238
|
// resolves against whatever that file names - which on a machine configured for
|
|
226
239
|
// GitHub Packages is a 404 and a process that never starts. A health check whose
|
|
227
240
|
// one step silently fails is worse than no step. Rule: smoke-npm-scope-pinning.sh.
|
|
228
|
-
const SUBTREES =
|
|
241
|
+
const SUBTREES = HOST.install.subtrees;
|
|
229
242
|
|
|
230
243
|
// Runs before everything else so a non-darwin host gets one honest line instead
|
|
231
244
|
// of a cascade of failures whose common cause is never stated. This blocks
|
|
@@ -247,16 +260,16 @@ function checkHostPlatform() {
|
|
|
247
260
|
}
|
|
248
261
|
|
|
249
262
|
function checkInstallPresent() {
|
|
250
|
-
if (!existsSync(
|
|
263
|
+
if (!existsSync(HOST_TREE)) {
|
|
251
264
|
report(
|
|
252
265
|
"install-present",
|
|
253
266
|
"BLOCK",
|
|
254
|
-
`no install at ${
|
|
267
|
+
`no install at ${HOST_TREE}`,
|
|
255
268
|
"run npx --@mmerterden:registry=https://registry.npmjs.org @mmerterden/multi-agent-pipeline install",
|
|
256
269
|
);
|
|
257
270
|
return false;
|
|
258
271
|
}
|
|
259
|
-
const missing = SUBTREES.filter((d) => !existsSync(join(
|
|
272
|
+
const missing = SUBTREES.filter((d) => !existsSync(join(HOST_TREE, d)));
|
|
260
273
|
if (missing.length) {
|
|
261
274
|
report(
|
|
262
275
|
"install-present",
|
|
@@ -271,7 +284,7 @@ function checkInstallPresent() {
|
|
|
271
284
|
}
|
|
272
285
|
|
|
273
286
|
function checkInstallVersion() {
|
|
274
|
-
const stamp = join(
|
|
287
|
+
const stamp = join(HOST_TREE, ".pipeline-version");
|
|
275
288
|
if (!existsSync(stamp)) {
|
|
276
289
|
skip("install-version", "no .pipeline-version stamp in the installed tree");
|
|
277
290
|
return;
|
|
@@ -333,7 +346,7 @@ function checkUpdatePolicy() {
|
|
|
333
346
|
}
|
|
334
347
|
|
|
335
348
|
function checkScriptSurface() {
|
|
336
|
-
const cmdDir = join(
|
|
349
|
+
const cmdDir = join(HOST_TREE, HOST.install.commandSpecs);
|
|
337
350
|
if (!existsSync(cmdDir)) {
|
|
338
351
|
skip("script-surface", "no installed command tree to read");
|
|
339
352
|
return;
|
|
@@ -347,13 +360,19 @@ function checkScriptSurface() {
|
|
|
347
360
|
// `scripts/nested/bar.mjs` was truncated to the directory, so as long as the
|
|
348
361
|
// directory existed a missing file one level inside it passed - the check
|
|
349
362
|
// reported OK for exactly the case it exists to catch.
|
|
363
|
+
// The install rewrites `$HOME/.claude/...` into the host's own root as the
|
|
364
|
+
// files land, so the text to match is this host's spelling, not the one the
|
|
365
|
+
// repo is written in.
|
|
350
366
|
for (const m of text.matchAll(
|
|
351
|
-
|
|
367
|
+
new RegExp(
|
|
368
|
+
`\\$HOME/\\${HOST.install.root}/(scripts|lib)/([A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*)`,
|
|
369
|
+
"g",
|
|
370
|
+
),
|
|
352
371
|
)) {
|
|
353
372
|
wanted.add(join(m[1], m[2]));
|
|
354
373
|
}
|
|
355
374
|
}
|
|
356
|
-
const missing = [...wanted].filter((rel) => !existsSync(join(
|
|
375
|
+
const missing = [...wanted].filter((rel) => !existsSync(join(HOST_TREE, rel))).sort();
|
|
357
376
|
if (missing.length) {
|
|
358
377
|
report(
|
|
359
378
|
"script-surface",
|
|
@@ -368,7 +387,7 @@ function checkScriptSurface() {
|
|
|
368
387
|
}
|
|
369
388
|
|
|
370
389
|
function checkSkillSiblings() {
|
|
371
|
-
const sib = join(
|
|
390
|
+
const sib = join(HOST_TREE, "scripts", "skill-siblings.mjs");
|
|
372
391
|
if (!existsSync(sib)) {
|
|
373
392
|
skip("skill-siblings", "skill-siblings.mjs is not installed");
|
|
374
393
|
return;
|
|
@@ -409,7 +428,7 @@ function checkSkillSiblings() {
|
|
|
409
428
|
// as unsynced told the user to run a sync that would change nothing - a health
|
|
410
429
|
// check whose one step is a no-op teaches people to ignore it.
|
|
411
430
|
const localOnly = new Set();
|
|
412
|
-
const cmdRoot = join(
|
|
431
|
+
const cmdRoot = join(HOST_TREE, HOST.install.commandSpecs);
|
|
413
432
|
if (existsSync(cmdRoot)) {
|
|
414
433
|
for (const d of readdirSync(cmdRoot)) {
|
|
415
434
|
const f = join(cmdRoot, d, "SKILL.md");
|
|
@@ -499,6 +518,13 @@ function checkIdentity() {
|
|
|
499
518
|
}
|
|
500
519
|
|
|
501
520
|
function checkHookCoverage() {
|
|
521
|
+
// These hooks are entries in Claude Code's own settings file, which only that
|
|
522
|
+
// host reads, so the template and the file it merges into are both under the
|
|
523
|
+
// state root rather than under this host's tree.
|
|
524
|
+
if (HOST_ID !== "claude") {
|
|
525
|
+
skip("hook-coverage", `${HOST.label} does not read Claude Code's hooks file`);
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
502
528
|
const tpl = join(CLAUDE, "templates", "claude-hooks.json");
|
|
503
529
|
if (!existsSync(tpl)) {
|
|
504
530
|
skip("hook-coverage", "no hooks template installed to compare against");
|
|
@@ -563,6 +589,13 @@ function checkHookCoverage() {
|
|
|
563
589
|
// ~/.claude/scripts, no disableAllHooks; and which preferences do nothing
|
|
564
590
|
// because their hook is missing (lib/hook-registration.mjs).
|
|
565
591
|
function checkHookReachability() {
|
|
592
|
+
// These hooks are entries in Claude Code's own settings file, which only that
|
|
593
|
+
// host reads, so the template and the file it merges into are both under the
|
|
594
|
+
// state root rather than under this host's tree.
|
|
595
|
+
if (HOST_ID !== "claude") {
|
|
596
|
+
skip("hook-reachability", `${HOST.label} does not read Claude Code's hooks file`);
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
566
599
|
const tpl = join(CLAUDE, "templates", "claude-hooks.json");
|
|
567
600
|
if (!existsSync(tpl)) {
|
|
568
601
|
skip("hook-reachability", "no hooks template installed to compare against");
|
|
@@ -715,7 +748,7 @@ function checkGuardRules() {
|
|
|
715
748
|
}
|
|
716
749
|
|
|
717
750
|
function credentialInventory() {
|
|
718
|
-
const inv = join(
|
|
751
|
+
const inv = join(HOST_TREE, "lib", "credential-inventory.sh");
|
|
719
752
|
if (!existsSync(inv)) return null;
|
|
720
753
|
try {
|
|
721
754
|
const args = PROBE ? [inv, "--json", "--probe"] : [inv, "--json"];
|
|
@@ -804,27 +837,29 @@ function checkCredentials(inv) {
|
|
|
804
837
|
|
|
805
838
|
// The toolkit's store_* tools find the App Store Connect and Google Play keys
|
|
806
839
|
// through a reference file naming Keychain services, written by
|
|
807
|
-
// write-store-config.mjs from
|
|
808
|
-
// reflect means the keys sit in the Keychain and every
|
|
809
|
-
// "not onboarded".
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
appstore_connect_private_key: "appStoreConnect",
|
|
840
|
+
// write-store-config.mjs from the items this machine's accounts name. A file
|
|
841
|
+
// that does not reflect them means the keys sit in the Keychain and every
|
|
842
|
+
// store call still says "not onboarded". No account is nothing claimed, so
|
|
843
|
+
// that case is OK.
|
|
844
|
+
const STORE_OF_SERVICE = {
|
|
845
|
+
appstore_connect: "appStoreConnect",
|
|
814
846
|
google_play: "googlePlay",
|
|
815
847
|
};
|
|
848
|
+
const STORE_SLOTS = {
|
|
849
|
+
appstore_connect: ["key_id", "issuer_id", "private_key"],
|
|
850
|
+
google_play: ["service_account_json"],
|
|
851
|
+
};
|
|
816
852
|
const STORE_LABELS = { appStoreConnect: "App Store Connect", googlePlay: "Google Play" };
|
|
817
853
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
|
|
854
|
+
/** The stores whose keys this machine's accounts name at all. */
|
|
855
|
+
function storesNamed(prefs) {
|
|
856
|
+
const named = itemNames(prefs).filter((x) => STORE_SLOTS[x.service]?.includes(x.slot));
|
|
857
|
+
return [...new Set(named.map((x) => STORE_OF_SERVICE[x.service]))];
|
|
858
|
+
}
|
|
823
859
|
|
|
824
860
|
function checkStoreReference() {
|
|
825
861
|
const prefsFile = PREFS;
|
|
826
|
-
const
|
|
827
|
-
const mapped = Object.keys(STORE_OF_KEY).filter((k) => typeof km[k] === "string" && km[k].trim());
|
|
862
|
+
const mapped = storesNamed(readJson(prefsFile));
|
|
828
863
|
if (!mapped.length) {
|
|
829
864
|
ok("store-reference");
|
|
830
865
|
return;
|
|
@@ -871,7 +906,7 @@ function checkStoreReference() {
|
|
|
871
906
|
return;
|
|
872
907
|
}
|
|
873
908
|
const partial = Object.entries(res.stores || {}).filter(
|
|
874
|
-
([store, v]) => !v.included && mapped.
|
|
909
|
+
([store, v]) => !v.included && mapped.includes(store),
|
|
875
910
|
);
|
|
876
911
|
if (partial.length) {
|
|
877
912
|
report(
|
|
@@ -982,7 +1017,7 @@ function checkMcpRegistration() {
|
|
|
982
1017
|
"mcp-registration",
|
|
983
1018
|
"INFO",
|
|
984
1019
|
"multi-agent is not registered as an MCP server, so its tools are unavailable",
|
|
985
|
-
|
|
1020
|
+
`install it with ${[HOST.cli.candidates[0], "mcp", "add", ...HOST.cli.scopeArgs, "multi-agent"].join(" ")}`,
|
|
986
1021
|
);
|
|
987
1022
|
return;
|
|
988
1023
|
}
|
|
@@ -1443,7 +1478,7 @@ const REMOVED_COMMANDS = [
|
|
|
1443
1478
|
];
|
|
1444
1479
|
|
|
1445
1480
|
function checkRoutineCommands() {
|
|
1446
|
-
const root = join(
|
|
1481
|
+
const root = join(HOST_TREE, HOST.install.commandSpecs);
|
|
1447
1482
|
const routines = [];
|
|
1448
1483
|
try {
|
|
1449
1484
|
for (const name of readdirSync(root)) {
|
|
@@ -1515,7 +1550,7 @@ function checkFreeModels() {
|
|
|
1515
1550
|
}
|
|
1516
1551
|
const lib = [
|
|
1517
1552
|
join(HERE, "..", "lib", "toolkit-llm.sh"),
|
|
1518
|
-
join(
|
|
1553
|
+
join(HOST_TREE, "lib", "toolkit-llm.sh"),
|
|
1519
1554
|
].find((p) => existsSync(p));
|
|
1520
1555
|
if (!lib) {
|
|
1521
1556
|
report(
|
|
@@ -1604,8 +1639,59 @@ function checkFreeModels() {
|
|
|
1604
1639
|
// from a copy the installer keeps at the installed Xcode build. A newer Xcode
|
|
1605
1640
|
// leaves that copy older than what the Mac offers, which degrades the answer
|
|
1606
1641
|
// rather than breaking a run, so it tops out at WARN.
|
|
1642
|
+
// The local-model host runs a model served from this machine, so two things
|
|
1643
|
+
// have to be true that no other host needs: a model and address are recorded,
|
|
1644
|
+
// and the server answers. Both are checked where they are used rather than at
|
|
1645
|
+
// the first dispatch, because a run that reaches a phase and then cannot ask a
|
|
1646
|
+
// model has already spent the setup.
|
|
1647
|
+
function checkLocalModel() {
|
|
1648
|
+
if (HOST_ID !== "local") {
|
|
1649
|
+
skip("local-model", `${HOST.label} does not run a model served from this machine`);
|
|
1650
|
+
return;
|
|
1651
|
+
}
|
|
1652
|
+
const cfg = readJson(PREFS)?.global?.localModel ?? null;
|
|
1653
|
+
const problem = localModelProblem(cfg);
|
|
1654
|
+
if (problem) {
|
|
1655
|
+
report("local-model", "BLOCK", problem, `set global.localModel in ${PREFS}`);
|
|
1656
|
+
return;
|
|
1657
|
+
}
|
|
1658
|
+
if (!PROBE) {
|
|
1659
|
+
ok("local-model");
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
// --probe only: a reachability check costs a request, and a doctor run that
|
|
1663
|
+
// wakes a model loader every time would be its own problem.
|
|
1664
|
+
const url = new URL("models", cfg.baseUrl.endsWith("/") ? cfg.baseUrl : `${cfg.baseUrl}/`);
|
|
1665
|
+
try {
|
|
1666
|
+
execFileSync("curl", ["-sS", "-m", "5", "-o", "/dev/null", "-w", "%{http_code}", url.href], {
|
|
1667
|
+
encoding: "utf8",
|
|
1668
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1669
|
+
});
|
|
1670
|
+
} catch {
|
|
1671
|
+
report(
|
|
1672
|
+
"local-model",
|
|
1673
|
+
"BLOCK",
|
|
1674
|
+
`nothing answered at ${url.origin}, so no phase can reach a model`,
|
|
1675
|
+
"start the local model server, then re-run this check",
|
|
1676
|
+
);
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
ok("local-model");
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1607
1682
|
function checkXcodeSkills() {
|
|
1608
1683
|
const s = xcodeSkillsStatus(HOME);
|
|
1684
|
+
// Apple's set reaches Claude Code as a linked plugin and every other host as
|
|
1685
|
+
// copied skill directories, which this status cannot see. Reporting the
|
|
1686
|
+
// Claude linkage on another host told the user to fix something that is not
|
|
1687
|
+
// how their host receives them.
|
|
1688
|
+
if (HOST_ID !== "claude") {
|
|
1689
|
+
skip(
|
|
1690
|
+
"xcode-skills",
|
|
1691
|
+
`${HOST.label} receives Apple's Xcode skills as copies, not as a linked plugin`,
|
|
1692
|
+
);
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1609
1695
|
if (!s.available) {
|
|
1610
1696
|
skip(
|
|
1611
1697
|
"xcode-skills",
|
|
@@ -1617,8 +1703,8 @@ function checkXcodeSkills() {
|
|
|
1617
1703
|
report(
|
|
1618
1704
|
"xcode-skills",
|
|
1619
1705
|
"INFO",
|
|
1620
|
-
`Apple's Xcode skills (${s.skills}, Xcode ${s.build}) are not linked into
|
|
1621
|
-
|
|
1706
|
+
`Apple's Xcode skills (${s.skills}, Xcode ${s.build}) are not linked into ${HOST.label}`,
|
|
1707
|
+
`run ${hostCommand("update", HERE)}, or node install.js ${HOST.install.flag} from the pipeline checkout`,
|
|
1622
1708
|
);
|
|
1623
1709
|
return;
|
|
1624
1710
|
}
|
|
@@ -2088,6 +2174,7 @@ function main() {
|
|
|
2088
2174
|
[["usage-register"], checkUsageRegister],
|
|
2089
2175
|
[["access"], checkAccessState],
|
|
2090
2176
|
[["free-models"], checkFreeModels],
|
|
2177
|
+
[["local-model"], checkLocalModel],
|
|
2091
2178
|
[["xcode-skills"], checkXcodeSkills],
|
|
2092
2179
|
[["routine-commands"], checkRoutineCommands],
|
|
2093
2180
|
[["mcp-legacy-names"], checkMcpLegacyNames],
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* entry-mode.mjs - what a command should do when it was invoked with nothing.
|
|
4
|
+
*
|
|
5
|
+
* `/multi-agent` and `/multi-agent:analysis` are both argument-shaped: a key,
|
|
6
|
+
* a URL, `repo#N`, free text, a sub-command. Typing one of those is fast once
|
|
7
|
+
* you know the forms, and a wall to read for everyone else, so a bare
|
|
8
|
+
* invocation now asks instead of printing the guide.
|
|
9
|
+
*
|
|
10
|
+
* Deciding that is three lines of judgement that must come out the same on
|
|
11
|
+
* every host, so it is decided here rather than in each command's prose. The
|
|
12
|
+
* answer is one word on stdout:
|
|
13
|
+
*
|
|
14
|
+
* typed arguments were given; route them as before
|
|
15
|
+
* picker nothing was given; ask
|
|
16
|
+
* usage a modifier with no task: `autopilot` on its own says
|
|
17
|
+
* how to run, not what to run
|
|
18
|
+
* refuse-unattended nothing was given and nobody is there to answer
|
|
19
|
+
*
|
|
20
|
+
* The last one is why this exists as a gate rather than a convenience: an
|
|
21
|
+
* unattended run that reaches a question stops until it times out, and it
|
|
22
|
+
* stops having produced nothing. A run with no task is a configuration
|
|
23
|
+
* mistake, and saying so in one line beats waiting thirty minutes to say it.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* entry-mode.mjs --args "<raw arguments>" [--command multi-agent|analysis]
|
|
27
|
+
*
|
|
28
|
+
* Exit: 0 always, except 2 for a usage error. The word is the answer.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { exitOnHelp } from "../lib/cli-help.mjs";
|
|
32
|
+
|
|
33
|
+
exitOnHelp(import.meta.url);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Arguments that say how to run rather than what to run.
|
|
37
|
+
*
|
|
38
|
+
* `autopilot` alone, `--loop 3` alone: each one modifies a task that is not
|
|
39
|
+
* there. Answering with the picker would be worse than it sounds, because the
|
|
40
|
+
* modifier would be silently dropped and the run would go interactive.
|
|
41
|
+
*/
|
|
42
|
+
const MODIFIERS = [
|
|
43
|
+
/^autopilot$/i,
|
|
44
|
+
/^--loop(=.*)?$/i,
|
|
45
|
+
/^--review-rounds(=.*)?$/i,
|
|
46
|
+
/^--no-cache$/i,
|
|
47
|
+
/^--preview-\S*$/i,
|
|
48
|
+
/^--lang(=.*)?$/i,
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/** Whether every word given is a modifier or a modifier's value. */
|
|
52
|
+
function onlyModifiers(words) {
|
|
53
|
+
if (!words.length) return false;
|
|
54
|
+
let expectValue = false;
|
|
55
|
+
for (const word of words) {
|
|
56
|
+
if (expectValue && !word.startsWith("--")) {
|
|
57
|
+
expectValue = false;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const hit = MODIFIERS.find((re) => re.test(word));
|
|
61
|
+
if (!hit) return false;
|
|
62
|
+
expectValue = word.startsWith("--") && !word.includes("=");
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The mode for one invocation.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} args - the raw argument string the host passed through
|
|
71
|
+
* @param {object} env - the environment, for the unattended flag
|
|
72
|
+
* @returns {"typed"|"picker"|"usage"|"refuse-unattended"}
|
|
73
|
+
*/
|
|
74
|
+
export function entryMode(args, env = {}) {
|
|
75
|
+
const words = String(args ?? "")
|
|
76
|
+
.trim()
|
|
77
|
+
.split(/\s+/)
|
|
78
|
+
.filter(Boolean);
|
|
79
|
+
const unattended = String(env.MULTI_AGENT_UNATTENDED ?? "") === "1";
|
|
80
|
+
if (!words.length) return unattended ? "refuse-unattended" : "picker";
|
|
81
|
+
if (onlyModifiers(words)) return unattended ? "refuse-unattended" : "usage";
|
|
82
|
+
return "typed";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function main(argv) {
|
|
86
|
+
let args = null;
|
|
87
|
+
for (let i = 0; i < argv.length; i++) {
|
|
88
|
+
if (argv[i] === "--args") args = argv[i + 1] ?? "";
|
|
89
|
+
if (argv[i] === "--command") i++;
|
|
90
|
+
}
|
|
91
|
+
if (args === null) {
|
|
92
|
+
process.stderr.write('entry-mode: --args "<raw arguments>" is required\n');
|
|
93
|
+
return 2;
|
|
94
|
+
}
|
|
95
|
+
process.stdout.write(entryMode(args, process.env) + "\n");
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (process.argv[1] && process.argv[1].endsWith("entry-mode.mjs")) {
|
|
100
|
+
process.exitCode = main(process.argv.slice(2));
|
|
101
|
+
}
|
|
@@ -17,17 +17,15 @@
|
|
|
17
17
|
* estimate.mjs --jql "<query with statusCategory = Done>" [--roles "iOS,Android,Test"] [--json]
|
|
18
18
|
*
|
|
19
19
|
* Host: JIRA_BASE_URL, else https://<JIRA_HOST or prefs .global.hosts.jira>.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* Host and token come from one Jira account, resolved together: the token is
|
|
21
|
+
* only produced for the host that account names, and it travels only in the
|
|
22
|
+
* Authorization header. Read only.
|
|
22
23
|
*
|
|
23
24
|
* Exit: 0 report printed, 2 usage or auth, 5 a Jira call failed.
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
|
-
import { homedir } from "node:os";
|
|
27
|
-
|
|
28
|
-
import { resolveToken } from "../lib/credential-resolve.mjs";
|
|
29
27
|
import { runMain } from "../lib/fatal.mjs";
|
|
30
|
-
import {
|
|
28
|
+
import { resolveSecretAsync, selectAccount } from "../lib/service-account.mjs";
|
|
31
29
|
import { exitOnHelp } from "../lib/cli-help.mjs";
|
|
32
30
|
|
|
33
31
|
exitOnHelp(import.meta.url);
|
|
@@ -87,12 +85,21 @@ function matchesRole(summary, role) {
|
|
|
87
85
|
return new RegExp(`(?<![\\p{L}\\p{N}])${esc}(?![\\p{L}\\p{N}])`, "iu").test(s);
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
/**
|
|
89
|
+
* The Jira base URL this run is for, checked against an account that exists.
|
|
90
|
+
*
|
|
91
|
+
* A base URL in the environment is honoured, but it is still a destination: it
|
|
92
|
+
* is passed to the resolver, so a host no account covers is a refusal rather
|
|
93
|
+
* than a request that goes out with whatever token was lying around.
|
|
94
|
+
*/
|
|
95
|
+
function jiraBase(env = process.env) {
|
|
96
|
+
const asked = env.JIRA_BASE_URL ? env.JIRA_BASE_URL.replace(/\/+$/, "") : "";
|
|
97
|
+
const chosen = selectAccount({ service: "jira", url: asked || undefined }, { env });
|
|
98
|
+
if (!chosen.ok) return chosen;
|
|
99
|
+
return {
|
|
100
|
+
ok: true,
|
|
101
|
+
base: asked || chosen.account.baseUrl || `https://${chosen.account.hosts[0]}`,
|
|
102
|
+
};
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
async function jira(base, token, path) {
|
|
@@ -132,13 +139,20 @@ async function main() {
|
|
|
132
139
|
process.exitCode = 2;
|
|
133
140
|
return;
|
|
134
141
|
}
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
process.
|
|
142
|
+
const target = jiraBase();
|
|
143
|
+
if (!target.ok) {
|
|
144
|
+
process.stderr.write(`ERR: ${target.message} ${target.remedy}\n`);
|
|
145
|
+
process.exitCode = 2;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const base = target.base;
|
|
149
|
+
const answer = await resolveSecretAsync({ service: "jira", url: base });
|
|
150
|
+
if (!answer.ok) {
|
|
151
|
+
process.stderr.write(`ERR: ${answer.message} ${answer.remedy}\n`);
|
|
139
152
|
process.exitCode = 2;
|
|
140
153
|
return;
|
|
141
154
|
}
|
|
155
|
+
const token = answer.secret;
|
|
142
156
|
const roles = (arg(argv, "--roles") || "")
|
|
143
157
|
.split(",")
|
|
144
158
|
.map((r) => r.trim())
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
// anyone can install off npm. A person can paste the one line they think
|
|
15
15
|
// matters; a script cannot know which line that is.
|
|
16
16
|
//
|
|
17
|
-
// Auth reuses the usage ingest token
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
17
|
+
// Auth reuses the usage ingest token this machine already registered, resolved
|
|
18
|
+
// through lib/usage-token.mjs for this endpoint and no other, so nothing new
|
|
19
|
+
// has to be onboarded. Unlike usage telemetry, `optOut` does NOT silence this:
|
|
20
|
+
// telemetry is passive collection, feedback is a deliberate act by the person
|
|
21
|
+
// running the command, and silently dropping something a user chose to send is
|
|
22
|
+
// worse than not offering the command.
|
|
22
23
|
//
|
|
23
24
|
// Usage:
|
|
24
25
|
// node feedback-send.mjs --text "<message>" [--kind bug|idea|question]
|
|
@@ -78,8 +79,10 @@ function host() {
|
|
|
78
79
|
return "unknown";
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
// The endpoint is passed in because it is the destination the token is about to
|
|
83
|
+
// reach: a usage account that does not cover it hands nothing out.
|
|
84
|
+
function resolveToken(endpoint) {
|
|
85
|
+
return resolveUsageToken(readPrefs(), { endpoint });
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
async function main() {
|
|
@@ -121,7 +124,7 @@ async function main() {
|
|
|
121
124
|
process.exit(1);
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
const token = resolveToken();
|
|
127
|
+
const token = resolveToken(endpoint);
|
|
125
128
|
if (!token) {
|
|
126
129
|
process.stderr.write(
|
|
127
130
|
`ERROR: no ingest token. Run ${hostCommand("update", import.meta.dirname)} once (it registers one) or ${hostCommand("setup", import.meta.dirname)}.\n`,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* skillCount a count of pipeline/skills/shared/external/<name>/SKILL.md
|
|
14
14
|
* skillCountAll every SKILL.md under pipeline/skills, at any depth
|
|
15
15
|
* agentCount a count of pipeline/agents/*.md
|
|
16
|
-
* hosts
|
|
16
|
+
* hosts every host the registry declares, by label
|
|
17
17
|
* toolCount the toolkit's own tools/list response, when reachable
|
|
18
18
|
* toolCategories that same response, grouped by the prefix in each tool name
|
|
19
19
|
* pluginSkillCount every SKILL.md in the plugin marketplace, when checked out,
|
|
@@ -43,6 +43,7 @@ import { fileURLToPath } from "node:url";
|
|
|
43
43
|
import { spawnSync } from "node:child_process";
|
|
44
44
|
import { siblingsParent } from "./_sibling-root.mjs";
|
|
45
45
|
import { exitOnHelp } from "../lib/cli-help.mjs";
|
|
46
|
+
import { HOST_IDS, host } from "../lib/host.mjs";
|
|
46
47
|
import { SERVER_CHECKOUT_DIRS } from "../lib/mcp-rename.mjs";
|
|
47
48
|
|
|
48
49
|
exitOnHelp(import.meta.url);
|
|
@@ -233,14 +234,11 @@ const facts = {
|
|
|
233
234
|
// Both are headline figures on the site; generated from pipeline/agents and
|
|
234
235
|
// install/, so the sub-agent count and the host list follow what ships.
|
|
235
236
|
agentCount: readdirSync(join(ROOT, "pipeline", "agents")).filter((f) => f.endsWith(".md")).length,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
f.replace(".mjs", "")
|
|
242
|
-
],
|
|
243
|
-
)
|
|
237
|
+
// From the host registry, not from the files in install/: a host whose
|
|
238
|
+
// installer is another host's (the local one runs the Codex installer) has
|
|
239
|
+
// no file of its own, and a list built from filenames leaves it out of every
|
|
240
|
+
// sentence that counts hosts.
|
|
241
|
+
hosts: HOST_IDS.map((id) => host(id).label)
|
|
244
242
|
.filter(Boolean)
|
|
245
243
|
.sort(),
|
|
246
244
|
toolCount,
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
# jira-attach.sh <issue-key> <file> [file...]
|
|
14
14
|
#
|
|
15
15
|
# Env:
|
|
16
|
-
# JIRA_BASE https://host -
|
|
17
|
-
#
|
|
16
|
+
# JIRA_BASE https://host - names which account to use, when more than
|
|
17
|
+
# one is configured. Otherwise the account resolver picks.
|
|
18
|
+
# JIRA_TOKEN_KEY a store item name, when the account is to be named by item.
|
|
19
|
+
# JIRA_TOKEN a token for a run with no configured account.
|
|
18
20
|
#
|
|
19
21
|
# Output (stdout), one line per uploaded file:
|
|
20
22
|
# <filename>\t<content-url>
|
|
@@ -30,32 +32,21 @@ shift 2>/dev/null || true
|
|
|
30
32
|
exit 2
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
PREFS="$HOME/.claude/multi-agent-preferences.json"
|
|
34
|
-
|
|
35
35
|
_MA_JA_HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
36
36
|
# shellcheck source=/dev/null
|
|
37
37
|
if [ -f "$_MA_JA_HERE/../lib/user-facing.sh" ]; then . "$_MA_JA_HERE/../lib/user-facing.sh"; else . "$HOME/.claude/lib/user-facing.sh"; fi
|
|
38
|
+
# shellcheck source=/dev/null
|
|
39
|
+
if [ -f "$_MA_JA_HERE/../lib/_service-account.sh" ]; then . "$_MA_JA_HERE/../lib/_service-account.sh"; else . "$HOME/.claude/lib/_service-account.sh"; fi
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
try{const g=(JSON.parse(fs.readFileSync(process.argv[1],"utf8")).global||{});
|
|
43
|
-
process.stdout.write((g.hosts||{}).jira||"")}catch{process.stdout.write("")}
|
|
44
|
-
' "$PREFS" 2>/dev/null)
|
|
45
|
-
fi
|
|
46
|
-
[ -n "$JIRA_BASE" ] || { echo "jira-attach: no Jira host (set JIRA_BASE or prefs hosts.jira)" >&2; exit 2; }
|
|
47
|
-
case "$JIRA_BASE" in http*) ;; *) JIRA_BASE="https://$JIRA_BASE" ;; esac
|
|
41
|
+
SA_PICK=()
|
|
42
|
+
if [ -n "${JIRA_BASE:-}" ]; then SA_PICK+=(--host "$JIRA_BASE"); fi
|
|
43
|
+
if [ -n "${JIRA_TOKEN_KEY:-}" ]; then SA_PICK+=(--item "$JIRA_TOKEN_KEY"); fi
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
' "$PREFS" 2>/dev/null)
|
|
55
|
-
[ -n "$KEY" ] || { echo "jira-attach: keychainMapping.jira is not set - onboard it via $(ma_command setup)" >&2; exit 2; }
|
|
56
|
-
JIRA_TOKEN=$(bash "$HOME/.claude/lib/credential-store.sh" get "$KEY" 2>/dev/null)
|
|
57
|
-
fi
|
|
58
|
-
[ -n "${JIRA_TOKEN:-}" ] || { echo "jira-attach: no Jira token - onboard it via $(ma_command setup)" >&2; exit 2; }
|
|
45
|
+
JIRA_BASE="$(sa_base jira "${SA_PICK[@]+"${SA_PICK[@]}"}")" || {
|
|
46
|
+
echo "jira-attach: $(sa_explain)" >&2
|
|
47
|
+
exit 2
|
|
48
|
+
}
|
|
49
|
+
[ -n "$JIRA_BASE" ] || { echo "jira-attach: no Jira account - add one with $(ma_command setup)" >&2; exit 2; }
|
|
59
50
|
|
|
60
51
|
RC=0
|
|
61
52
|
for f in "$@"; do
|
|
@@ -64,12 +55,16 @@ for f in "$@"; do
|
|
|
64
55
|
RC=3
|
|
65
56
|
continue
|
|
66
57
|
fi
|
|
67
|
-
# The
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
# The config carries the URL as well as the credential, so the two cannot be
|
|
59
|
+
# separated: a redirect is refused rather than followed with the header on.
|
|
60
|
+
cfg=$(sa_cfg jira "$JIRA_BASE/rest/api/2/issue/$ISSUE/attachments" bearer \
|
|
61
|
+
"${SA_PICK[@]+"${SA_PICK[@]}"}") || {
|
|
62
|
+
echo "jira-attach: $(sa_explain)" >&2
|
|
63
|
+
exit 2
|
|
64
|
+
}
|
|
65
|
+
resp=$(curl -sS -X POST --config "$cfg" \
|
|
70
66
|
-H "X-Atlassian-Token: no-check" \
|
|
71
|
-
-F "file=@$f"
|
|
72
|
-
"$JIRA_BASE/rest/api/2/issue/$ISSUE/attachments" 2>/dev/null)
|
|
67
|
+
-F "file=@$f" 2>/dev/null)
|
|
73
68
|
line=$(printf '%s' "$resp" | node -e '
|
|
74
69
|
let b="";process.stdin.on("data",d=>b+=d).on("end",()=>{
|
|
75
70
|
try{
|