@uniqbit/mate-core 0.18.1-canary.0 → 0.18.1-canary.2
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/claude-plugin/hooks/session-banner.mjs +1 -1
- package/opencode-plugin/server.ts +5 -0
- package/opencode-plugin/src/add-dir.ts +118 -0
- package/opencode-plugin/src/companion.ts +180 -0
- package/opencode-plugin/src/server.ts +26 -0
- package/opencode-plugin/src/tui.tsx +1 -0
- package/opencode-plugin/tui.tsx +2 -0
- package/package.json +13 -6
- package/src/cli/commands/artifact/finish/engine.ts +1 -1
- package/src/cli/commands/artifact/finish/git.ts +75 -51
- package/src/cli/commands/companion/hub.ts +1 -1
- package/src/cli/commands/companion/link.ts +13 -59
- package/src/cli/commands/doctor.ts +30 -4
- package/src/cli/commands/install.ts +17 -1
- package/src/cli/commands/plugin/plugin.ts +0 -4
- package/src/cli/commands/report/formatter.ts +0 -4
- package/src/cli/commands/studio/selection.ts +3 -0
- package/src/cli/commands/studio/terminal-launch.ts +1 -51
- package/src/cli/commands/studio/terminal.ts +2 -13
- package/src/cli/commands/studio/vault.ts +5 -3
- package/src/cli/commands/studio/views/workflow/steps.ts +5 -4
- package/src/cli/commands/update.ts +4 -20
- package/src/cli/commands/working/cleanup.ts +4 -1
- package/src/cli/launch-selector.tsx +0 -318
- package/src/cli/main.ts +0 -29
- package/src/cli/setup-selector.tsx +1 -1
- package/src/cli/usage.ts +0 -1
- package/src/hooks/session-banner.ts +7 -5
- package/src/hooks/validate-artifact-path.ts +17 -6
- package/src/lib/opencode-plugin-package.ts +7 -28
- package/src/lib/orchestrator/adapters/opencode.ts +28 -67
- package/src/lib/orchestrator/companion-git-sync.ts +29 -93
- package/src/lib/orchestrator/companion-hub.ts +71 -110
- package/src/lib/orchestrator/repo-local-registry.ts +0 -21
- package/src/lib/orchestrator/types.ts +0 -6
- package/src/lib/orchestrator/working-repo-projection.ts +13 -9
- package/src/lib/package-paths.ts +32 -0
- package/src/lib/prebuilt-workspace.ts +0 -3
- package/src/opencode/companion-hooks.ts +15 -10
- package/src/runtime/companion-git.ts +327 -84
- package/src/runtime/companion-sync.ts +34 -43
- package/src/runtime/index.ts +7 -5
- package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +2 -2
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +25 -0
- package/src/templates/mate-skills/agents/mate-grilling/SKILL.md +9 -7
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +34 -4
- package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +2 -2
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +25 -0
- package/src/templates/mate-skills/claude/mate-grilling/SKILL.md +9 -7
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +34 -4
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +68 -77
- package/src/tools/setup/capabilities/graphify.ts +0 -4
- package/src/tools/setup/dynamic-plugins/frozen.ts +24 -3
- package/src/tools/setup/dynamic-plugins/loader.ts +16 -0
- package/src/tools/setup/dynamic-plugins/policy.ts +55 -0
- package/src/tools/setup/dynamic-plugins/staging.ts +55 -0
- package/src/tools/setup/dynamic-plugins/verify.ts +22 -18
- package/src/tools/setup/providers/opencode-format.ts +4 -0
- package/src/tools/setup/providers/opencode.ts +9 -65
- package/src/tools/setup/runtime-documents.ts +8 -9
- package/src/cli/commands/plugin/verify.ts +0 -29
|
@@ -243,9 +243,6 @@ exports[`runtime surface golden fixtures setup graphify × opencode 1`] = `
|
|
|
243
243
|
"tokens": 15000,
|
|
244
244
|
},
|
|
245
245
|
},
|
|
246
|
-
"plugins": [
|
|
247
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
248
|
-
],
|
|
249
246
|
"references": {
|
|
250
247
|
"mate": "..",
|
|
251
248
|
},
|
|
@@ -348,6 +345,9 @@ exports[`runtime surface golden fixtures setup graphify × opencode 2`] = `
|
|
|
348
345
|
"resource": "<root>/companion/**",
|
|
349
346
|
},
|
|
350
347
|
],
|
|
348
|
+
"plugins": [
|
|
349
|
+
"<opencode-plugin>",
|
|
350
|
+
],
|
|
351
351
|
"references": {
|
|
352
352
|
"mate": "<root>/companion",
|
|
353
353
|
},
|
|
@@ -371,7 +371,7 @@ exports[`runtime surface golden fixtures setup graphify × opencode 3`] = `
|
|
|
371
371
|
],
|
|
372
372
|
"kind": "list",
|
|
373
373
|
"values": [
|
|
374
|
-
"
|
|
374
|
+
"<opencode-plugin>",
|
|
375
375
|
],
|
|
376
376
|
},
|
|
377
377
|
{
|
|
@@ -472,9 +472,6 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
472
472
|
"tokens": 15000,
|
|
473
473
|
},
|
|
474
474
|
},
|
|
475
|
-
"plugins": [
|
|
476
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
477
|
-
],
|
|
478
475
|
"references": {
|
|
479
476
|
"mate": "..",
|
|
480
477
|
},
|
|
@@ -634,6 +631,9 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] =
|
|
|
634
631
|
"resource": "<root>/companion/**",
|
|
635
632
|
},
|
|
636
633
|
],
|
|
634
|
+
"plugins": [
|
|
635
|
+
"<opencode-plugin>",
|
|
636
|
+
],
|
|
637
637
|
"references": {
|
|
638
638
|
"mate": "<root>/companion",
|
|
639
639
|
},
|
|
@@ -731,7 +731,7 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
|
|
|
731
731
|
],
|
|
732
732
|
"kind": "list",
|
|
733
733
|
"values": [
|
|
734
|
-
"
|
|
734
|
+
"<opencode-plugin>",
|
|
735
735
|
],
|
|
736
736
|
},
|
|
737
737
|
{
|
|
@@ -1044,9 +1044,6 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 1`] = `
|
|
|
1044
1044
|
},
|
|
1045
1045
|
},
|
|
1046
1046
|
},
|
|
1047
|
-
"plugins": [
|
|
1048
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
1049
|
-
],
|
|
1050
1047
|
"references": {
|
|
1051
1048
|
"mate": "..",
|
|
1052
1049
|
},
|
|
@@ -1125,6 +1122,9 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 2`] = `
|
|
|
1125
1122
|
"resource": "<root>/companion/**",
|
|
1126
1123
|
},
|
|
1127
1124
|
],
|
|
1125
|
+
"plugins": [
|
|
1126
|
+
"<opencode-plugin>",
|
|
1127
|
+
],
|
|
1128
1128
|
"references": {
|
|
1129
1129
|
"mate": "<root>/companion",
|
|
1130
1130
|
},
|
|
@@ -1148,7 +1148,7 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 3`] = `
|
|
|
1148
1148
|
],
|
|
1149
1149
|
"kind": "list",
|
|
1150
1150
|
"values": [
|
|
1151
|
-
"
|
|
1151
|
+
"<opencode-plugin>",
|
|
1152
1152
|
],
|
|
1153
1153
|
},
|
|
1154
1154
|
{
|
|
@@ -1295,9 +1295,6 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 1`]
|
|
|
1295
1295
|
},
|
|
1296
1296
|
},
|
|
1297
1297
|
},
|
|
1298
|
-
"plugins": [
|
|
1299
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
1300
|
-
],
|
|
1301
1298
|
"references": {
|
|
1302
1299
|
"mate": "..",
|
|
1303
1300
|
},
|
|
@@ -1430,6 +1427,9 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`]
|
|
|
1430
1427
|
"resource": "<root>/companion/**",
|
|
1431
1428
|
},
|
|
1432
1429
|
],
|
|
1430
|
+
"plugins": [
|
|
1431
|
+
"<opencode-plugin>",
|
|
1432
|
+
],
|
|
1433
1433
|
"references": {
|
|
1434
1434
|
"mate": "<root>/companion",
|
|
1435
1435
|
},
|
|
@@ -1545,7 +1545,7 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
|
|
|
1545
1545
|
],
|
|
1546
1546
|
"kind": "list",
|
|
1547
1547
|
"values": [
|
|
1548
|
-
"
|
|
1548
|
+
"<opencode-plugin>",
|
|
1549
1549
|
],
|
|
1550
1550
|
},
|
|
1551
1551
|
{
|
|
@@ -1798,7 +1798,6 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
|
|
|
1798
1798
|
},
|
|
1799
1799
|
},
|
|
1800
1800
|
"plugins": [
|
|
1801
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
1802
1801
|
"context-mode@1.0.169",
|
|
1803
1802
|
],
|
|
1804
1803
|
"references": {
|
|
@@ -1871,6 +1870,9 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 2`] = `
|
|
|
1871
1870
|
"resource": "<root>/companion/**",
|
|
1872
1871
|
},
|
|
1873
1872
|
],
|
|
1873
|
+
"plugins": [
|
|
1874
|
+
"<opencode-plugin>",
|
|
1875
|
+
],
|
|
1874
1876
|
"references": {
|
|
1875
1877
|
"mate": "<root>/companion",
|
|
1876
1878
|
},
|
|
@@ -1894,7 +1896,7 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 3`] = `
|
|
|
1894
1896
|
],
|
|
1895
1897
|
"kind": "list",
|
|
1896
1898
|
"values": [
|
|
1897
|
-
"
|
|
1899
|
+
"<opencode-plugin>",
|
|
1898
1900
|
],
|
|
1899
1901
|
},
|
|
1900
1902
|
{
|
|
@@ -1973,7 +1975,6 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
|
|
|
1973
1975
|
},
|
|
1974
1976
|
},
|
|
1975
1977
|
"plugins": [
|
|
1976
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
1977
1978
|
"context-mode@1.0.169",
|
|
1978
1979
|
],
|
|
1979
1980
|
"references": {
|
|
@@ -2094,6 +2095,9 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2
|
|
|
2094
2095
|
"resource": "<root>/companion/**",
|
|
2095
2096
|
},
|
|
2096
2097
|
],
|
|
2098
|
+
"plugins": [
|
|
2099
|
+
"<opencode-plugin>",
|
|
2100
|
+
],
|
|
2097
2101
|
"references": {
|
|
2098
2102
|
"mate": "<root>/companion",
|
|
2099
2103
|
},
|
|
@@ -2189,7 +2193,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
|
|
|
2189
2193
|
],
|
|
2190
2194
|
"kind": "list",
|
|
2191
2195
|
"values": [
|
|
2192
|
-
"
|
|
2196
|
+
"<opencode-plugin>",
|
|
2193
2197
|
],
|
|
2194
2198
|
},
|
|
2195
2199
|
{
|
|
@@ -2446,9 +2450,6 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 1`] = `
|
|
|
2446
2450
|
"tokens": 15000,
|
|
2447
2451
|
},
|
|
2448
2452
|
},
|
|
2449
|
-
"plugins": [
|
|
2450
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
2451
|
-
],
|
|
2452
2453
|
"references": {
|
|
2453
2454
|
"mate": "..",
|
|
2454
2455
|
},
|
|
@@ -2522,6 +2523,9 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 2`] = `
|
|
|
2522
2523
|
"resource": "<root>/companion/**",
|
|
2523
2524
|
},
|
|
2524
2525
|
],
|
|
2526
|
+
"plugins": [
|
|
2527
|
+
"<opencode-plugin>",
|
|
2528
|
+
],
|
|
2525
2529
|
"references": {
|
|
2526
2530
|
"mate": "<root>/companion",
|
|
2527
2531
|
},
|
|
@@ -2545,7 +2549,7 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 3`] = `
|
|
|
2545
2549
|
],
|
|
2546
2550
|
"kind": "list",
|
|
2547
2551
|
"values": [
|
|
2548
|
-
"
|
|
2552
|
+
"<opencode-plugin>",
|
|
2549
2553
|
],
|
|
2550
2554
|
},
|
|
2551
2555
|
{
|
|
@@ -2646,9 +2650,6 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
|
|
|
2646
2650
|
"tokens": 15000,
|
|
2647
2651
|
},
|
|
2648
2652
|
},
|
|
2649
|
-
"plugins": [
|
|
2650
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
2651
|
-
],
|
|
2652
2653
|
"references": {
|
|
2653
2654
|
"mate": "..",
|
|
2654
2655
|
},
|
|
@@ -2768,6 +2769,9 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2
|
|
|
2768
2769
|
"resource": "<root>/companion/**",
|
|
2769
2770
|
},
|
|
2770
2771
|
],
|
|
2772
|
+
"plugins": [
|
|
2773
|
+
"<opencode-plugin>",
|
|
2774
|
+
],
|
|
2771
2775
|
"references": {
|
|
2772
2776
|
"mate": "<root>/companion",
|
|
2773
2777
|
},
|
|
@@ -2864,7 +2868,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
|
|
|
2864
2868
|
],
|
|
2865
2869
|
"kind": "list",
|
|
2866
2870
|
"values": [
|
|
2867
|
-
"
|
|
2871
|
+
"<opencode-plugin>",
|
|
2868
2872
|
],
|
|
2869
2873
|
},
|
|
2870
2874
|
{
|
|
@@ -2942,13 +2946,13 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
|
|
|
2942
2946
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
2943
2947
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
2944
2948
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
2945
|
-
"mate-domain-modeling/SKILL.md": "
|
|
2949
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
2946
2950
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
2947
2951
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
2948
|
-
"mate-grill-me/SKILL.md": "
|
|
2952
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
2949
2953
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
2950
|
-
"mate-grilling/SKILL.md": "
|
|
2951
|
-
"mate-interview-me/SKILL.md": "
|
|
2954
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
2955
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
2952
2956
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
2953
2957
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
2954
2958
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -3137,9 +3141,6 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
|
|
|
3137
3141
|
"tokens": 15000,
|
|
3138
3142
|
},
|
|
3139
3143
|
},
|
|
3140
|
-
"plugins": [
|
|
3141
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
3142
|
-
],
|
|
3143
3144
|
"references": {
|
|
3144
3145
|
"mate": "..",
|
|
3145
3146
|
},
|
|
@@ -3156,13 +3157,13 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
|
|
|
3156
3157
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
3157
3158
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
3158
3159
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
3159
|
-
"mate-domain-modeling/SKILL.md": "
|
|
3160
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
3160
3161
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
3161
3162
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
3162
|
-
"mate-grill-me/SKILL.md": "
|
|
3163
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
3163
3164
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
3164
|
-
"mate-grilling/SKILL.md": "
|
|
3165
|
-
"mate-interview-me/SKILL.md": "
|
|
3165
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
3166
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
3166
3167
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
3167
3168
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
3168
3169
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -3231,6 +3232,9 @@ exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
|
|
|
3231
3232
|
"resource": "<root>/companion/**",
|
|
3232
3233
|
},
|
|
3233
3234
|
],
|
|
3235
|
+
"plugins": [
|
|
3236
|
+
"<opencode-plugin>",
|
|
3237
|
+
],
|
|
3234
3238
|
"references": {
|
|
3235
3239
|
"mate": "<root>/companion",
|
|
3236
3240
|
},
|
|
@@ -3254,7 +3258,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 3`] = `
|
|
|
3254
3258
|
],
|
|
3255
3259
|
"kind": "list",
|
|
3256
3260
|
"values": [
|
|
3257
|
-
"
|
|
3261
|
+
"<opencode-plugin>",
|
|
3258
3262
|
],
|
|
3259
3263
|
},
|
|
3260
3264
|
{
|
|
@@ -3332,13 +3336,13 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
|
|
|
3332
3336
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
3333
3337
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
3334
3338
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
3335
|
-
"mate-domain-modeling/SKILL.md": "
|
|
3339
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
3336
3340
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
3337
3341
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
3338
|
-
"mate-grill-me/SKILL.md": "
|
|
3342
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
3339
3343
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
3340
|
-
"mate-grilling/SKILL.md": "
|
|
3341
|
-
"mate-interview-me/SKILL.md": "
|
|
3344
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
3345
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
3342
3346
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
3343
3347
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
3344
3348
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -3356,9 +3360,6 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
|
|
|
3356
3360
|
"tokens": 15000,
|
|
3357
3361
|
},
|
|
3358
3362
|
},
|
|
3359
|
-
"plugins": [
|
|
3360
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
3361
|
-
],
|
|
3362
3363
|
"references": {
|
|
3363
3364
|
"mate": "..",
|
|
3364
3365
|
},
|
|
@@ -3375,13 +3376,13 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
|
|
|
3375
3376
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
3376
3377
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
3377
3378
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
3378
|
-
"mate-domain-modeling/SKILL.md": "
|
|
3379
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
3379
3380
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
3380
3381
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
3381
|
-
"mate-grill-me/SKILL.md": "
|
|
3382
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
3382
3383
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
3383
|
-
"mate-grilling/SKILL.md": "
|
|
3384
|
-
"mate-interview-me/SKILL.md": "
|
|
3384
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
3385
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
3385
3386
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
3386
3387
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
3387
3388
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -3498,6 +3499,9 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
|
|
|
3498
3499
|
"resource": "<root>/companion/**",
|
|
3499
3500
|
},
|
|
3500
3501
|
],
|
|
3502
|
+
"plugins": [
|
|
3503
|
+
"<opencode-plugin>",
|
|
3504
|
+
],
|
|
3501
3505
|
"references": {
|
|
3502
3506
|
"mate": "<root>/companion",
|
|
3503
3507
|
},
|
|
@@ -3607,7 +3611,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
|
|
|
3607
3611
|
],
|
|
3608
3612
|
"kind": "list",
|
|
3609
3613
|
"values": [
|
|
3610
|
-
"
|
|
3614
|
+
"<opencode-plugin>",
|
|
3611
3615
|
],
|
|
3612
3616
|
},
|
|
3613
3617
|
{
|
|
@@ -3799,13 +3803,13 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
3799
3803
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
3800
3804
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
3801
3805
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
3802
|
-
"mate-domain-modeling/SKILL.md": "
|
|
3806
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
3803
3807
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
3804
3808
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
3805
|
-
"mate-grill-me/SKILL.md": "
|
|
3809
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
3806
3810
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
3807
|
-
"mate-grilling/SKILL.md": "
|
|
3808
|
-
"mate-interview-me/SKILL.md": "
|
|
3811
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
3812
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
3809
3813
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
3810
3814
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
3811
3815
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -3838,7 +3842,6 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
3838
3842
|
},
|
|
3839
3843
|
},
|
|
3840
3844
|
"plugins": [
|
|
3841
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
3842
3845
|
"context-mode@1.0.169",
|
|
3843
3846
|
],
|
|
3844
3847
|
"references": {
|
|
@@ -3878,13 +3881,13 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
|
3878
3881
|
"mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
|
|
3879
3882
|
"mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
|
|
3880
3883
|
"mate-create-report/SKILL.md": "4dda64fab7b7",
|
|
3881
|
-
"mate-domain-modeling/SKILL.md": "
|
|
3884
|
+
"mate-domain-modeling/SKILL.md": "722d0e5a972d",
|
|
3882
3885
|
"mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
|
|
3883
3886
|
"mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
|
|
3884
|
-
"mate-grill-me/SKILL.md": "
|
|
3887
|
+
"mate-grill-me/SKILL.md": "cc9d4d422120",
|
|
3885
3888
|
"mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
|
|
3886
|
-
"mate-grilling/SKILL.md": "
|
|
3887
|
-
"mate-interview-me/SKILL.md": "
|
|
3889
|
+
"mate-grilling/SKILL.md": "f37ff4dd9b6d",
|
|
3890
|
+
"mate-interview-me/SKILL.md": "5ac966ca1e48",
|
|
3888
3891
|
"mate-openspec-backfill/SKILL.md": "fa73daee9951",
|
|
3889
3892
|
"mate-show-me/SKILL.md": "7ccd84f967cf",
|
|
3890
3893
|
"mate-simplify-code/SKILL.md": "6fff7fff920c",
|
|
@@ -4027,6 +4030,9 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
|
|
|
4027
4030
|
"resource": "<root>/companion/**",
|
|
4028
4031
|
},
|
|
4029
4032
|
],
|
|
4033
|
+
"plugins": [
|
|
4034
|
+
"<opencode-plugin>",
|
|
4035
|
+
],
|
|
4030
4036
|
"references": {
|
|
4031
4037
|
"mate": "<root>/companion",
|
|
4032
4038
|
},
|
|
@@ -4167,7 +4173,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
|
|
|
4167
4173
|
],
|
|
4168
4174
|
"kind": "list",
|
|
4169
4175
|
"values": [
|
|
4170
|
-
"
|
|
4176
|
+
"<opencode-plugin>",
|
|
4171
4177
|
],
|
|
4172
4178
|
},
|
|
4173
4179
|
{
|
|
@@ -4252,9 +4258,6 @@ exports[`runtime surface golden fixtures teardown graphify × claude+opencode 1`
|
|
|
4252
4258
|
"tokens": 15000,
|
|
4253
4259
|
},
|
|
4254
4260
|
},
|
|
4255
|
-
"plugins": [
|
|
4256
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
4257
|
-
],
|
|
4258
4261
|
"references": {
|
|
4259
4262
|
"mate": "..",
|
|
4260
4263
|
},
|
|
@@ -4312,9 +4315,6 @@ exports[`runtime surface golden fixtures teardown tokensave × claude+opencode 1
|
|
|
4312
4315
|
"tokens": 15000,
|
|
4313
4316
|
},
|
|
4314
4317
|
},
|
|
4315
|
-
"plugins": [
|
|
4316
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
4317
|
-
],
|
|
4318
4318
|
"references": {
|
|
4319
4319
|
"mate": "..",
|
|
4320
4320
|
},
|
|
@@ -4373,9 +4373,6 @@ exports[`runtime surface golden fixtures teardown context-mode × claude+opencod
|
|
|
4373
4373
|
"tokens": 15000,
|
|
4374
4374
|
},
|
|
4375
4375
|
},
|
|
4376
|
-
"plugins": [
|
|
4377
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
4378
|
-
],
|
|
4379
4376
|
"references": {
|
|
4380
4377
|
"mate": "..",
|
|
4381
4378
|
},
|
|
@@ -4433,9 +4430,6 @@ exports[`runtime surface golden fixtures teardown react-doctor × claude+opencod
|
|
|
4433
4430
|
"tokens": 15000,
|
|
4434
4431
|
},
|
|
4435
4432
|
},
|
|
4436
|
-
"plugins": [
|
|
4437
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
4438
|
-
],
|
|
4439
4433
|
"references": {
|
|
4440
4434
|
"mate": "..",
|
|
4441
4435
|
},
|
|
@@ -4493,9 +4487,6 @@ exports[`runtime surface golden fixtures teardown openspec × claude+opencode 1`
|
|
|
4493
4487
|
"tokens": 15000,
|
|
4494
4488
|
},
|
|
4495
4489
|
},
|
|
4496
|
-
"plugins": [
|
|
4497
|
-
"@uniqbit/mate-opencode-plugin@<version>",
|
|
4498
|
-
],
|
|
4499
4490
|
"references": {
|
|
4500
4491
|
"mate": "..",
|
|
4501
4492
|
},
|
|
@@ -71,10 +71,6 @@ const CLAUDE_MANAGED_HOOK_COMMAND_SUFFIXES = new Set([
|
|
|
71
71
|
"/.claude/hooks/mate-artifact-finish.sh",
|
|
72
72
|
]);
|
|
73
73
|
|
|
74
|
-
export function deriveGraphifyProviders(activeProviders: string[]): string[] {
|
|
75
|
-
return GRAPHIFY_SUPPORTED_PROVIDERS.filter((p) => activeProviders.includes(p));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
74
|
// graphifyy's `graphify install` emits a skill whose pipeline writes to a
|
|
79
75
|
// cwd-relative graphify-out/ using literal path strings (inline Python + bash)
|
|
80
76
|
// that graphifyy's own GRAPHIFY_OUT/paths.py override cannot redirect. Rewrite
|
|
@@ -5,8 +5,14 @@ import path from "node:path";
|
|
|
5
5
|
import type { PluginDeclaration } from "../../../lib/orchestrator/types";
|
|
6
6
|
import type { NpmInstallRunner, PluginInstallResult } from "./install";
|
|
7
7
|
import { dynamicPluginsWorkspaceRoot } from "./paths";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
disallowedPluginMessage,
|
|
10
|
+
isPluginAllowed,
|
|
11
|
+
PluginPolicyError,
|
|
12
|
+
readPluginPolicy,
|
|
13
|
+
} from "./policy";
|
|
14
|
+
|
|
15
|
+
/** Raised before anything is installed: policy, manifest or lockfile inputs are unusable. */
|
|
10
16
|
export class FrozenInstallError extends Error {}
|
|
11
17
|
|
|
12
18
|
export interface FrozenInstallDeps {
|
|
@@ -106,7 +112,8 @@ async function treeMismatches(workspaceRoot: string, lock: Lockfile): Promise<st
|
|
|
106
112
|
|
|
107
113
|
/**
|
|
108
114
|
* Deployment restore: installs exactly what the committed lockfile records.
|
|
109
|
-
* Inputs are validated before npm runs — the
|
|
115
|
+
* Inputs are validated before npm runs — the appliance allowlist, the
|
|
116
|
+
* workspace manifest against the declarations, and the lockfile against the
|
|
110
117
|
* manifest — and neither tracked file is ever rewritten. An installed tree is
|
|
111
118
|
* reused only when it matches the lockfile's versions and integrity.
|
|
112
119
|
*/
|
|
@@ -120,6 +127,20 @@ export async function installDeclaredPluginsFrozen(
|
|
|
120
127
|
const desired: Record<string, string> = {};
|
|
121
128
|
for (const declaration of sorted) desired[declaration.package] = declaration.version;
|
|
122
129
|
|
|
130
|
+
let policy: ReturnType<typeof readPluginPolicy>;
|
|
131
|
+
try {
|
|
132
|
+
policy = readPluginPolicy(deps.env ?? process.env);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
if (error instanceof PluginPolicyError) throw new FrozenInstallError(error.message);
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
const refused = sorted.filter((declaration) => !isPluginAllowed(policy, declaration.package));
|
|
138
|
+
if (refused.length > 0) {
|
|
139
|
+
throw new FrozenInstallError(
|
|
140
|
+
refused.map((declaration) => disallowedPluginMessage(declaration.package)).join("\n"),
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
123
144
|
const manifestFile = path.join(workspaceRoot, "package.json");
|
|
124
145
|
const lockFile = path.join(workspaceRoot, "package-lock.json");
|
|
125
146
|
const [manifestText, lockText] = await Promise.all([readText(manifestFile), readText(lockFile)]);
|
|
@@ -14,6 +14,12 @@ import {
|
|
|
14
14
|
type PluginHost,
|
|
15
15
|
} from "./host";
|
|
16
16
|
import { dynamicPluginsWorkspaceRoot, pluginPackageRoot } from "./paths";
|
|
17
|
+
import {
|
|
18
|
+
disallowedPluginMessage,
|
|
19
|
+
isPluginAllowed,
|
|
20
|
+
PluginPolicyError,
|
|
21
|
+
readPluginPolicy,
|
|
22
|
+
} from "./policy";
|
|
17
23
|
|
|
18
24
|
interface PluginManifest {
|
|
19
25
|
mate?: { pluginApiVersion?: unknown };
|
|
@@ -47,6 +53,16 @@ export async function loadDynamicPlugin(
|
|
|
47
53
|
const name = declaration.package;
|
|
48
54
|
const packageRoot = pluginPackageRoot(companionPath, name);
|
|
49
55
|
|
|
56
|
+
/** Fails closed: a malformed policy allows nothing. Checked before any plugin file is touched. */
|
|
57
|
+
try {
|
|
58
|
+
if (!isPluginAllowed(readPluginPolicy(deps.env ?? process.env), name)) {
|
|
59
|
+
return { ok: false, warning: `${disallowedPluginMessage(name)}; not loaded.` };
|
|
60
|
+
}
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (!(error instanceof PluginPolicyError)) throw error;
|
|
63
|
+
return { ok: false, warning: `plugin "${name}" not loaded: ${error.message}` };
|
|
64
|
+
}
|
|
65
|
+
|
|
50
66
|
let manifest: PluginManifest;
|
|
51
67
|
try {
|
|
52
68
|
manifest = JSON.parse(
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Environment variable carrying the appliance's declared-plugin package allowlist. */
|
|
2
|
+
export const ALLOWED_PLUGINS_ENV = "MATE_ALLOWED_PLUGINS";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Parsed allowlist: exact package names and scope-wide `@scope/*` patterns.
|
|
6
|
+
* An empty list permits no package; the policy's absence permits all.
|
|
7
|
+
*/
|
|
8
|
+
export interface PluginPolicy {
|
|
9
|
+
exact: string[];
|
|
10
|
+
scopes: string[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class PluginPolicyError extends Error {}
|
|
14
|
+
|
|
15
|
+
const EXACT_PATTERN = /^(@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
|
|
16
|
+
const SCOPE_PATTERN = /^@[a-z0-9][a-z0-9._~-]*\/\*$/;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Parses a comma-separated allowlist. `undefined` means no policy; an empty
|
|
20
|
+
* or blank string is an explicit empty policy. Malformed entries throw so a
|
|
21
|
+
* typo can never widen or silently narrow the trust decision.
|
|
22
|
+
*/
|
|
23
|
+
export function parseAllowedPlugins(raw: string | undefined): PluginPolicy | null {
|
|
24
|
+
if (raw === undefined) return null;
|
|
25
|
+
const policy: PluginPolicy = { exact: [], scopes: [] };
|
|
26
|
+
if (raw.trim() === "") return policy;
|
|
27
|
+
for (const part of raw.split(",")) {
|
|
28
|
+
const entry = part.trim();
|
|
29
|
+
if (SCOPE_PATTERN.test(entry)) policy.scopes.push(entry.slice(0, entry.indexOf("/") + 1));
|
|
30
|
+
else if (EXACT_PATTERN.test(entry)) policy.exact.push(entry);
|
|
31
|
+
else {
|
|
32
|
+
throw new PluginPolicyError(
|
|
33
|
+
`${ALLOWED_PLUGINS_ENV}: malformed entry ${JSON.stringify(entry)}; expected an exact package name or a scope pattern such as "@acme/*"`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return policy;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Reads the effective policy from an environment; throws on a malformed value. */
|
|
41
|
+
export function readPluginPolicy(
|
|
42
|
+
env: Record<string, string | undefined> = process.env,
|
|
43
|
+
): PluginPolicy | null {
|
|
44
|
+
return parseAllowedPlugins(env[ALLOWED_PLUGINS_ENV]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function isPluginAllowed(policy: PluginPolicy | null, packageName: string): boolean {
|
|
48
|
+
if (policy === null) return true;
|
|
49
|
+
if (policy.exact.includes(packageName)) return true;
|
|
50
|
+
return policy.scopes.some((scope) => packageName.startsWith(scope));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function disallowedPluginMessage(packageName: string): string {
|
|
54
|
+
return `plugin "${packageName}" is not allowed by ${ALLOWED_PLUGINS_ENV}`;
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
import { gitEnvironment } from "../../../runtime/companion-git";
|
|
7
|
+
|
|
8
|
+
export class TrackedOutputError extends Error {}
|
|
9
|
+
|
|
10
|
+
export type StagedProjection = (stagingPath: string) => Promise<void>;
|
|
11
|
+
|
|
12
|
+
function git(cwd: string, args: string[]): string {
|
|
13
|
+
const result = spawnSync("git", args, { cwd, encoding: "utf8", env: gitEnvironment() });
|
|
14
|
+
if (result.error || result.status !== 0) {
|
|
15
|
+
throw new TrackedOutputError(
|
|
16
|
+
`git ${args[0]} failed in ${cwd}: ${result.error?.message ?? result.stderr?.trim() ?? result.status}`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return result.stdout;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function changedPaths(cwd: string): string[] {
|
|
23
|
+
return git(cwd, ["status", "--porcelain", "--untracked-files=all"])
|
|
24
|
+
.split("\n")
|
|
25
|
+
.filter((line) => line.trim() !== "")
|
|
26
|
+
.map((line) => line.slice(3));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Checks that what plugins would generate is already committed. The live
|
|
31
|
+
* checkout must have no edits of its own; the projection then runs against a
|
|
32
|
+
* disposable clone of its commit, and any file that differs afterwards is
|
|
33
|
+
* drift. Nothing is written back to the live checkout. Returns the drifting
|
|
34
|
+
* paths (empty when the checkout is complete).
|
|
35
|
+
*/
|
|
36
|
+
export async function verifyTrackedPluginOutputs(
|
|
37
|
+
companionPath: string,
|
|
38
|
+
project: StagedProjection,
|
|
39
|
+
): Promise<string[]> {
|
|
40
|
+
const pending = changedPaths(companionPath);
|
|
41
|
+
if (pending.length > 0) {
|
|
42
|
+
throw new TrackedOutputError(
|
|
43
|
+
`the checkout has uncommitted changes, which frozen setup will not overwrite: ${pending.join(", ")}`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "mate-staging-"));
|
|
47
|
+
try {
|
|
48
|
+
const staged = path.join(root, "companion");
|
|
49
|
+
git(root, ["clone", "--quiet", "--no-hardlinks", companionPath, staged]);
|
|
50
|
+
await project(staged);
|
|
51
|
+
return changedPaths(staged);
|
|
52
|
+
} finally {
|
|
53
|
+
await fs.rm(root, { recursive: true, force: true });
|
|
54
|
+
}
|
|
55
|
+
}
|