workspai 0.50.0 → 0.52.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.
Files changed (135) hide show
  1. package/README.md +127 -497
  2. package/contracts/artifact-remediation-plan.v1.json +87 -0
  3. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +24 -0
  4. package/contracts/create-planner-capabilities.v1.json +10 -1
  5. package/contracts/doctor-project-evidence.v1.json +46 -0
  6. package/contracts/doctor-remediation-plan.v1.json +82 -0
  7. package/contracts/doctor-workspace-evidence.v1.json +46 -0
  8. package/contracts/extension-cli-compatibility.v1.json +6 -2
  9. package/contracts/published-contract-catalog.v1.json +22 -1
  10. package/contracts/runtime-command-surface.v1.json +104 -0
  11. package/contracts/workspace-intelligence/doctor-dependency-repair-transaction.v1.json +66 -0
  12. package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +5 -0
  13. package/contracts/workspace-intelligence/verified-goal-status.v1.json +27 -0
  14. package/contracts/workspace-intelligence/verified-goal.v1.json +163 -0
  15. package/contracts/workspace-intelligence-chain.v1.json +6 -0
  16. package/dist/analyze-J7VNZMDH.js +1 -0
  17. package/dist/artifact-remediation-plan-2UKY4TKO.js +3 -0
  18. package/dist/autopilot-release-UG23AWVH.js +1 -0
  19. package/dist/chunk-27UR373Z.js +1 -0
  20. package/dist/chunk-2PY65U6X.js +5 -0
  21. package/dist/{chunk-DQ3PI7EP.js → chunk-3D3PFPP5.js} +1 -1
  22. package/dist/chunk-4D7DIGAB.js +1 -0
  23. package/dist/{chunk-IND3TUVU.js → chunk-4UVGTFOX.js} +1 -1
  24. package/dist/chunk-5XJRCP3D.js +36 -0
  25. package/dist/chunk-62K2H72S.js +1 -0
  26. package/dist/chunk-6AXRIAP2.js +86 -0
  27. package/dist/chunk-6HJJHEL6.js +2 -0
  28. package/dist/{chunk-BHYTI3RH.js → chunk-6PBSAAS5.js} +1 -1
  29. package/dist/{chunk-MVLIONQD.js → chunk-7MQZQ4UU.js} +1 -1
  30. package/dist/chunk-7RLGOEWV.js +1 -0
  31. package/dist/{chunk-CV5HKU4P.js → chunk-7T4TSV5C.js} +1 -1
  32. package/dist/chunk-B4CPDK6J.js +2 -0
  33. package/dist/{chunk-SHXJ2GDR.js → chunk-DZ4VKAXB.js} +1 -1
  34. package/dist/{chunk-5EXZBCAZ.js → chunk-F4KBYFZ5.js} +1 -1
  35. package/dist/{chunk-LZQUZGXB.js → chunk-FRJYAJH6.js} +1 -1
  36. package/dist/chunk-FUPHQOJB.js +1 -0
  37. package/dist/{chunk-VKTUWUS6.js → chunk-GHB6QMQH.js} +1 -1
  38. package/dist/chunk-GR6442P7.js +1 -0
  39. package/dist/chunk-HPWLSLMC.js +8 -0
  40. package/dist/{chunk-KXG6E5VK.js → chunk-ICLYL3N5.js} +1 -1
  41. package/dist/chunk-IO54DFWR.js +691 -0
  42. package/dist/{chunk-RTVRZFIJ.js → chunk-KHEJO3JU.js} +1 -1
  43. package/dist/{chunk-IPJ5URDF.js → chunk-LOCPNNSK.js} +1 -1
  44. package/dist/chunk-LPCL4U4L.js +1 -0
  45. package/dist/{chunk-C35UXTDM.js → chunk-M5ICGR55.js} +1 -1
  46. package/dist/{chunk-SS2VV3D5.js → chunk-MBRU3VWJ.js} +2 -2
  47. package/dist/{chunk-DDQ3XK3H.js → chunk-MZFSINY7.js} +3 -3
  48. package/dist/chunk-OTDGTAZJ.js +1 -0
  49. package/dist/chunk-P4OSLAVD.js +3 -0
  50. package/dist/chunk-PS5F4DCT.js +1 -0
  51. package/dist/{chunk-C3FLCDRN.js → chunk-PTTZPDLX.js} +1 -1
  52. package/dist/chunk-Q6CUJ3WF.js +10 -0
  53. package/dist/{chunk-MV7KF75Q.js → chunk-QURMI7ID.js} +1 -1
  54. package/dist/{chunk-RVQLMTTI.js → chunk-ULR66OJR.js} +1 -1
  55. package/dist/chunk-WJVB6SSD.js +16 -0
  56. package/dist/chunk-WJY7ZXVJ.js +2 -0
  57. package/dist/{chunk-6UTM5AJI.js → chunk-XHRHNVCZ.js} +1 -1
  58. package/dist/chunk-ZTKIBREF.js +1 -0
  59. package/dist/{chunk-BQGBU2Y3.js → chunk-ZVOEPWQM.js} +1 -1
  60. package/dist/{create-I23DC7SN.js → create-ESK3CQPK.js} +1 -1
  61. package/dist/{doctor-DOOMYLIH.js → doctor-DLEBZSF7.js} +1 -1
  62. package/dist/index.d.ts +26 -11
  63. package/dist/index.js +129 -129
  64. package/dist/{pipeline-U77HSINC.js → pipeline-NT6AYYWM.js} +1 -1
  65. package/dist/{project-intelligence-lens-BKKVPCLC.js → project-intelligence-lens-Q4SZDI2N.js} +1 -1
  66. package/dist/project-test-coverage-A677ZLW3.js +1 -0
  67. package/dist/verified-goal-MJNZROS5.js +1 -0
  68. package/dist/{workspace-ZEYUVR26.js → workspace-LSOZM2CG.js} +1 -1
  69. package/dist/{workspace-agent-sync-DKYJLUDP.js → workspace-agent-sync-RZBQXCNJ.js} +1 -1
  70. package/dist/{workspace-archive-4JNT4S7N.js → workspace-archive-ZOWQXWJ6.js} +1 -1
  71. package/dist/workspace-context-IYJKO5BN.js +1 -0
  72. package/dist/{workspace-contract-PVLGPBBV.js → workspace-contract-AZFISDLS.js} +1 -1
  73. package/dist/workspace-explain-26UGV7L4.js +1 -0
  74. package/dist/workspace-explain-contract-GIWPCCEF.js +1 -0
  75. package/dist/{workspace-feedback-RATRXFUC.js → workspace-feedback-LIHEWTNV.js} +1 -1
  76. package/dist/{workspace-foundation-D33LJLGT.js → workspace-foundation-H5UTAUXQ.js} +1 -1
  77. package/dist/{workspace-graph-stream-THNG2T7R.js → workspace-graph-stream-KUDOZE73.js} +1 -1
  78. package/dist/workspace-graph-token-efficiency-5FNH4JZ5.js +1 -0
  79. package/dist/{workspace-history-EWFPT74O.js → workspace-history-HULG5EFN.js} +1 -1
  80. package/dist/{workspace-intelligence-MCNSWWDV.js → workspace-intelligence-A4UE4DZK.js} +1 -1
  81. package/dist/{workspace-intelligence-evaluation-7CABG5Y6.js → workspace-intelligence-evaluation-AOLGHYHC.js} +1 -1
  82. package/dist/workspace-intelligence-runner-42QI5RYA.js +1 -0
  83. package/dist/{workspace-intelligence-runtime-registry-ZZ3GRAL2.js → workspace-intelligence-runtime-registry-YOQ5GFFJ.js} +1 -1
  84. package/dist/{workspace-knowledge-graph-2EYR7N56.js → workspace-knowledge-graph-LEM6X5CM.js} +1 -1
  85. package/dist/{workspace-knowledge-graph-query-VOSPPH4W.js → workspace-knowledge-graph-query-EKHIE3E2.js} +1 -1
  86. package/dist/{workspace-mcp-serve-FLAVKWYW.js → workspace-mcp-serve-N2QPR7VJ.js} +1 -1
  87. package/dist/{workspace-model-FMFYLHE4.js → workspace-model-FJXX3NET.js} +1 -1
  88. package/dist/{workspace-onboarding-MYROZDI2.js → workspace-onboarding-IKFISWWY.js} +1 -1
  89. package/dist/workspace-readme-E2M35RJH.js +77 -0
  90. package/dist/{workspace-registry-summary-6VXIAQLX.js → workspace-registry-summary-HOQ3OBNT.js} +1 -1
  91. package/dist/workspace-run-GOZTUGJS.js +1 -0
  92. package/dist/{workspace-verify-FKYI65UQ.js → workspace-verify-32AWCJQG.js} +1 -1
  93. package/dist/workspace-watch-4WVNB26E.js +1 -0
  94. package/docs/README.md +1 -0
  95. package/docs/README_CONTENT_CONTRACT.md +98 -124
  96. package/docs/ci-workflows.md +53 -15
  97. package/docs/commands-reference.md +16 -2
  98. package/docs/doctor-command.md +16 -0
  99. package/docs/workspace-intelligence-runner.md +48 -0
  100. package/docs/workspace-knowledge-graph.md +39 -0
  101. package/docs/workspace-operations.md +9 -6
  102. package/package.json +9 -4
  103. package/scripts/enterprise-package-smoke.mjs +11 -0
  104. package/templates/kits/fastapi-ddd/README.md.j2 +1 -1
  105. package/templates/kits/fastapi-standard/README.md.j2 +1 -1
  106. package/templates/kits/nestjs-standard/Dockerfile.j2 +1 -1
  107. package/templates/kits/nestjs-standard/README.md.j2 +1 -1
  108. package/templates/kits/nestjs-standard/package.json.j2 +11 -2
  109. package/dist/analyze-ZFQWTCJQ.js +0 -1
  110. package/dist/artifact-remediation-plan-ICN3KOFG.js +0 -3
  111. package/dist/autopilot-release-VKXQ7BS7.js +0 -1
  112. package/dist/chunk-2AXEGYPL.js +0 -1
  113. package/dist/chunk-2D4UOYOJ.js +0 -1
  114. package/dist/chunk-AHLMIL2T.js +0 -1
  115. package/dist/chunk-AL2A7Q4X.js +0 -86
  116. package/dist/chunk-GNQRYISX.js +0 -5
  117. package/dist/chunk-I42F552T.js +0 -2
  118. package/dist/chunk-IDQKVJUF.js +0 -2
  119. package/dist/chunk-JFUD73OZ.js +0 -933
  120. package/dist/chunk-KKAOTTYO.js +0 -8
  121. package/dist/chunk-KMLPHFLD.js +0 -2
  122. package/dist/chunk-L2YK5RV2.js +0 -1
  123. package/dist/chunk-LAJM2SBP.js +0 -15
  124. package/dist/chunk-TDTCMZK7.js +0 -10
  125. package/dist/chunk-UETZ7USY.js +0 -36
  126. package/dist/chunk-WDKNMTJQ.js +0 -1
  127. package/dist/chunk-YPKNQCLK.js +0 -2
  128. package/dist/project-test-coverage-4TEHZJFC.js +0 -1
  129. package/dist/workspace-context-IHUFMZT3.js +0 -1
  130. package/dist/workspace-explain-64HNKAHO.js +0 -1
  131. package/dist/workspace-explain-contract-H7O26QJU.js +0 -1
  132. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +0 -1
  133. package/dist/workspace-intelligence-runner-TG2VLHNZ.js +0 -1
  134. package/dist/workspace-run-2ZI5UMJ2.js +0 -1
  135. package/dist/workspace-watch-RP5KMVP2.js +0 -1
@@ -34,6 +34,11 @@
34
34
  "type": "array",
35
35
  "items": { "type": "string" }
36
36
  },
37
+ "affectedProjectNames": {
38
+ "type": "array",
39
+ "items": { "type": "string", "minLength": 1 },
40
+ "uniqueItems": true
41
+ },
37
42
  "artifactPath": {
38
43
  "type": "string"
39
44
  },
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/verified-goal-status.v1.json",
4
+ "title": "Workspai Verified Goal Status",
5
+ "description": "The durable progress and evidence-derived terminal state of a Workspai verified goal.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "goalId", "goalFingerprint", "workspacePath", "updatedAt", "state", "attempt", "progress", "checks", "blockingReasons", "evidencePaths", "nextActions", "artifactPath"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "workspai.verified-goal-status.v1" },
10
+ "goalId": { "type": "string", "minLength": 8 },
11
+ "goalFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
12
+ "workspacePath": { "type": "string", "minLength": 1 },
13
+ "updatedAt": { "type": "string", "format": "date-time" },
14
+ "state": { "enum": ["planned", "active", "blocked", "verified", "failed", "cancelled"] },
15
+ "attempt": { "type": "integer", "minimum": 0 },
16
+ "progress": { "$ref": "#/$defs/measurement" },
17
+ "checks": { "type": "array", "items": { "type": "object", "required": ["id", "label", "status", "expected", "actual", "message"], "properties": { "id": { "type": "string", "minLength": 1 }, "label": { "type": "string", "minLength": 1 }, "status": { "enum": ["passed", "failed", "blocked", "missing", "skipped"] }, "expected": { "type": "string", "minLength": 1 }, "actual": { "type": "string", "minLength": 1 }, "evidencePath": { "type": "string", "minLength": 1 }, "message": { "type": "string", "minLength": 1 } }, "additionalProperties": false } },
18
+ "blockingReasons": { "type": "array", "items": { "type": "string", "minLength": 1 } },
19
+ "evidencePaths": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
20
+ "nextActions": { "type": "array", "items": { "type": "string", "minLength": 1 } },
21
+ "artifactPath": { "type": "string", "minLength": 1 }
22
+ },
23
+ "$defs": {
24
+ "measurement": { "type": "object", "required": ["measuredAt", "value", "target", "unit", "status", "evidencePaths", "message"], "properties": { "measuredAt": { "type": "string", "format": "date-time" }, "value": { "type": ["number", "null"] }, "target": { "type": ["number", "null"] }, "unit": { "enum": ["percent", "blocking-vulnerabilities", "gates", "unknown"] }, "status": { "enum": ["satisfied", "unsatisfied", "unavailable"] }, "evidencePaths": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "message": { "type": "string", "minLength": 1 } }, "additionalProperties": false }
25
+ },
26
+ "additionalProperties": false
27
+ }
@@ -0,0 +1,163 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/verified-goal.v1.json",
4
+ "title": "Workspai Verified Goal",
5
+ "description": "A durable, deterministic success contract for an agent-executed engineering goal.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "id",
10
+ "fingerprint",
11
+ "createdAt",
12
+ "updatedAt",
13
+ "workspace",
14
+ "scope",
15
+ "kind",
16
+ "summary",
17
+ "constraints",
18
+ "criteria",
19
+ "baseline",
20
+ "artifactPaths"
21
+ ],
22
+ "properties": {
23
+ "schemaVersion": { "const": "workspai.verified-goal.v1" },
24
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{7,95}$" },
25
+ "fingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
26
+ "createdAt": { "type": "string", "format": "date-time" },
27
+ "updatedAt": { "type": "string", "format": "date-time" },
28
+ "workspace": {
29
+ "type": "object",
30
+ "required": ["name", "path"],
31
+ "properties": {
32
+ "name": { "type": "string", "minLength": 1 },
33
+ "path": { "type": "string", "minLength": 1 }
34
+ },
35
+ "additionalProperties": false
36
+ },
37
+ "scope": {
38
+ "type": "object",
39
+ "required": ["kind"],
40
+ "properties": {
41
+ "kind": { "enum": ["workspace", "project"] },
42
+ "projectName": { "type": "string", "minLength": 1 },
43
+ "projectPath": { "type": "string", "minLength": 1 }
44
+ },
45
+ "allOf": [
46
+ {
47
+ "if": { "properties": { "kind": { "const": "project" } } },
48
+ "then": {
49
+ "properties": {
50
+ "projectName": { "type": "string", "minLength": 1 },
51
+ "projectPath": { "type": "string", "minLength": 1 }
52
+ },
53
+ "required": ["projectName", "projectPath"]
54
+ }
55
+ }
56
+ ],
57
+ "additionalProperties": false
58
+ },
59
+ "kind": { "enum": ["release-readiness", "dependency-security", "test-coverage"] },
60
+ "summary": { "type": "string", "minLength": 1 },
61
+ "constraints": {
62
+ "type": "object",
63
+ "required": ["allowBreakingChanges", "allowForce", "requireBuild", "requireTests"],
64
+ "properties": {
65
+ "allowBreakingChanges": { "type": "boolean" },
66
+ "allowForce": { "type": "boolean" },
67
+ "requireBuild": { "type": "boolean" },
68
+ "requireTests": { "type": "boolean" }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "criteria": {
73
+ "oneOf": [
74
+ {
75
+ "type": "object",
76
+ "required": ["kind", "readiness", "workspaceVerify"],
77
+ "properties": {
78
+ "kind": { "const": "release-readiness" },
79
+ "readiness": { "const": "pass" },
80
+ "workspaceVerify": { "const": "ready" }
81
+ },
82
+ "additionalProperties": false
83
+ },
84
+ {
85
+ "type": "object",
86
+ "required": ["kind", "maximumBlockingVulnerabilities", "requireFreshAudit"],
87
+ "properties": {
88
+ "kind": { "const": "dependency-security" },
89
+ "maximumBlockingVulnerabilities": { "const": 0 },
90
+ "requireFreshAudit": { "const": true }
91
+ },
92
+ "additionalProperties": false
93
+ },
94
+ {
95
+ "type": "object",
96
+ "required": ["kind", "metric", "minimumPercent"],
97
+ "properties": {
98
+ "kind": { "const": "test-coverage" },
99
+ "metric": { "const": "auto" },
100
+ "minimumPercent": { "type": "number", "minimum": 0, "maximum": 100 }
101
+ },
102
+ "additionalProperties": false
103
+ }
104
+ ]
105
+ },
106
+ "baseline": { "$ref": "#/$defs/measurement" },
107
+ "dependencySafetyBaseline": {
108
+ "type": "object",
109
+ "required": ["manifests"],
110
+ "properties": {
111
+ "manifests": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "object",
115
+ "required": ["path", "ecosystem", "sha256"],
116
+ "properties": {
117
+ "path": { "type": "string", "minLength": 1 },
118
+ "ecosystem": { "type": "string", "minLength": 1 },
119
+ "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
120
+ "dependencies": {
121
+ "type": "object",
122
+ "additionalProperties": { "type": "string", "minLength": 1 }
123
+ }
124
+ },
125
+ "additionalProperties": false
126
+ }
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ },
131
+ "artifactPaths": {
132
+ "type": "object",
133
+ "required": ["goal", "status", "latestReport"],
134
+ "properties": {
135
+ "goal": { "type": "string", "minLength": 1 },
136
+ "status": { "type": "string", "minLength": 1 },
137
+ "latestReport": { "type": "string", "minLength": 1 }
138
+ },
139
+ "additionalProperties": false
140
+ }
141
+ },
142
+ "$defs": {
143
+ "measurement": {
144
+ "type": "object",
145
+ "required": ["measuredAt", "value", "target", "unit", "status", "evidencePaths", "message"],
146
+ "properties": {
147
+ "measuredAt": { "type": "string", "format": "date-time" },
148
+ "value": { "type": ["number", "null"] },
149
+ "target": { "type": ["number", "null"] },
150
+ "unit": { "enum": ["percent", "blocking-vulnerabilities", "gates", "unknown"] },
151
+ "status": { "enum": ["satisfied", "unsatisfied", "unavailable"] },
152
+ "evidencePaths": {
153
+ "type": "array",
154
+ "items": { "type": "string", "minLength": 1 },
155
+ "uniqueItems": true
156
+ },
157
+ "message": { "type": "string", "minLength": 1 }
158
+ },
159
+ "additionalProperties": false
160
+ }
161
+ },
162
+ "additionalProperties": false
163
+ }
@@ -215,6 +215,12 @@
215
215
  "path": ".workspai/reports/workspace-intelligence-evaluation-last-run.json",
216
216
  "schemaVersion": "workspace-intelligence-evaluation.v1",
217
217
  "schemaContract": "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json"
218
+ },
219
+ {
220
+ "id": "verifiedGoalStatus",
221
+ "path": ".workspai/reports/verified-goal-last-run.json",
222
+ "schemaVersion": "workspai.verified-goal-status.v1",
223
+ "schemaContract": "contracts/workspace-intelligence/verified-goal-status.v1.json"
218
224
  }
219
225
  ]
220
226
  },
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-HPWLSLMC.js';
@@ -0,0 +1,3 @@
1
+ import {a as a$2}from'./chunk-ZTKIBREF.js';import {a as a$1}from'./chunk-2E6WGUN6.js';import {a,e,b as b$1}from'./chunk-MBRU3VWJ.js';import b from'path';import {existsSync}from'fs';import E from'fs-extra';var T=[{artifactKind:"bootstrap-compliance",cardId:"bootstrap",fileNames:["bootstrap-compliance.latest.json"]},{artifactKind:"doctor-workspace",cardId:"doctor",fileNames:["doctor-remediation-plan-last-run.json","doctor-last-run.json"]},{artifactKind:"analyze",cardId:"analyze",fileNames:["analyze-last-run.json"]},{artifactKind:"readiness",cardId:"readiness",fileNames:["release-readiness-last-run.json"]},{artifactKind:"pipeline",cardId:"pipeline",fileNames:["pipeline-last-run.json"]},{artifactKind:"workspace-run",cardId:"workspaceRun",fileNames:["workspace-run-last.json"]},{artifactKind:"workspace-verify",cardId:"workspaceVerify",fileNames:["workspace-verify-last-run.json"]}];function m(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function k(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}function v(e){return [...new Set(e.map(t=>t.trim()).filter(Boolean))]}function P(e,t,o){return o?t:b.relative(e,t).split(b.sep).join("/")}function B(e){let t=e?.trim()||"npx workspai bootstrap";if(!/(?:^|\s)--ci(?:\s|$)/.test(t)&&/(?:^|\s)--json(?:\s|$)/.test(t))return t.replace(/(?:^|\s)--json(?:\s|$)/,s=>{let r=s.startsWith(" ")?" ":"",i=s.endsWith(" ")?" ":"";return `${r}--ci --json${i}`}).trim();let o=/(?:^|\s)--ci(?:\s|$)/.test(t)?t:`${t} --ci`;return /(?:^|\s)--json(?:\s|$)/.test(o)?o:`${o} --json`}function _(e){return `${JSON.stringify({schemaVersion:"rapidkit.compatibility-matrix.v1",generatedAt:e,source:"workspai workspace remediation-plan",runtimes:{},notes:["Minimal enterprise baseline. Add runtime and toolchain entries as governance matures."]},null,2)}
2
+ `}function z(e){return `${JSON.stringify({schema_version:"1.0",enabled:false,strategy:"on-demand",artifacts:[],created_at:e,note:"Minimal enterprise baseline. Set enabled: true and add artifact entries to activate mirroring."},null,2)}
3
+ `}function V(e){let t=e.payload,o=k(t.blockers),s=k(t.blockingReasons),r=k(t.failures),i=k(t.reasons),c=k(t.policyViolations),n=m(t.summary),u=k(n?.blockers);if(e.artifactKind==="analyze"){let a=(Array.isArray(t.findings)?t.findings:[]).map(d=>m(d)).filter(d=>!!d).map(d=>String(d.message??d.title??d.id??"").trim()).filter(Boolean);return v([...o,...a,...s])}if(e.artifactKind==="workspace-run"){let p=m(t.stages),a=Object.entries(p??{}).flatMap(([d,f])=>{let h=m(f);return (Array.isArray(h?.projects)?h.projects:[]).map(l=>m(l)).filter(l=>!!l).filter(l=>l.status==="failed"||l.ok===false).map(l=>`${d}: ${String(l.project??l.name??"project")} failed`)});return v([...o,...a,...s])}return v([...o,...s,...r,...i,...c,...u])}function j(e){return {id:e.id,artifactKind:e.artifactKind,cardId:e.cardId,title:e.title,order:e.order,phase:e.phase,scope:e.scope??"workspace",...e.projectName?{projectName:e.projectName}:{},...e.projectPath?{projectPath:e.projectPath}:{},...e.sourceStepId?{sourceStepId:e.sourceStepId}:{},...e.dependsOn?{dependsOn:e.dependsOn}:{},...e.strategy?{strategy:structuredClone(e.strategy)}:{},...e.transaction?{transaction:structuredClone(e.transaction)}:{},status:e.status??"ready",mode:e.mode,risk:e.risk,requiresApproval:true,blocker:e.blocker,summary:e.summary,...e.command?{command:e.command}:{},verifyCommand:e.verifyCommand,cwd:e.cwd??"workspace",files:e.files??[],...e.operation?{operation:e.operation}:{},rollback:e.rollback??(e.operation?{available:true,strategy:"idempotent"}:{available:false,strategy:"none"}),notes:e.notes??[]}}function q(e){return (Array.isArray(e.report.payload.steps)?e.report.payload.steps:[]).flatMap((o,s)=>{let r=m(o),i=typeof r?.id=="string"?r.id.trim():"",c=typeof r?.projectName=="string"?r.projectName.trim():"",n=typeof r?.projectPath=="string"?r.projectPath.trim():"",u=typeof r?.originalCommand=="string"?r.originalCommand.trim():"";if(!r||!i||!c||!n)return [];let p=m(r.studioStatus),a=p?.state==="ready"||p?.state==="review-required"||p?.state==="blocked"||p?.state==="guidance-only"?p.state:"guidance-only",d=r.risk==="safe"||r.risk==="guarded"||r.risk==="invasive"?r.risk:"guarded",f=m(r.preview),h=P(e.workspacePath,n,e.includeAbsolutePaths),g=N({capability:{...r,command:u},absoluteProjectPath:n,includeAbsolutePaths:e.includeAbsolutePaths}),l=r.executableInCurrentEnvironment===true&&!!g,y=O({strategy:r.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),A=m(r.transaction),x=A?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone(A):void 0;return x&&(x.projectPath=h),[j({id:`doctor.${i}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof f?.title=="string"&&f.title.trim()?f.title.trim():`Repair ${c}`,order:e.startOrder+s,phase:typeof r.phase=="string"?r.phase:"doctor-remediation",blocker:typeof f?.summary=="string"&&f.summary.trim()?f.summary.trim():`Doctor remediation is pending for ${c}.`,summary:typeof f?.summary=="string"&&f.summary.trim()?f.summary.trim():`Execute the CLI-authored Doctor step for ${c}.`,mode:l?"run-command":"manual-guidance",risk:d,status:a,...l&&g?{command:g}:{},verifyCommand:typeof r.verifyCommand=="string"&&r.verifyCommand.trim()?r.verifyCommand.trim():"npx workspai doctor project --json",files:k(r.files).map(w=>{let R=b.isAbsolute(w)?w:b.resolve(n,w);return P(e.workspacePath,R,e.includeAbsolutePaths)}),notes:[`Source Doctor step: ${i}`,...typeof p?.reason=="string"?[p.reason]:[]],scope:"project",projectName:c,projectPath:h,sourceStepId:i,dependsOn:k(r.dependsOn).map(w=>`doctor.${w}`),strategy:y,transaction:x,cwd:"project",...m(r.rollback)?.available===true?{rollback:{available:true,strategy:"manual"}}:{}})]})}function N(e){let t=typeof e.capability.command=="string"?e.capability.command.trim():"";if(e.includeAbsolutePaths&&t)return t;let o=F({operation:e.capability.operation,absoluteProjectPath:e.absoluteProjectPath});if(o)return a$2(o);let s=m(e.capability.invocation),r=typeof s?.executable=="string"?s.executable.trim():"",i=k(s?.args);if(r)return [r,...i].map(n=>/^[a-zA-Z0-9_./:@=+-]+$/.test(n)?n:JSON.stringify(n)).join(" ");if(!t)return;let c=e.absoluteProjectPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t.replace(new RegExp(`^cd\\s+["']?${c}["']?\\s*&&\\s*`,"i"),"").replaceAll(e.absoluteProjectPath,".")}function F(e){let t=m(e.operation);if(!t||typeof t.type!="string")return;let o=structuredClone(t);for(let s of ["path","sourcePath"]){let r=o[s];if(typeof r!="string")continue;let i=b.isAbsolute(r)?b.relative(e.absoluteProjectPath,r):r;if(!i||i===".."||i.startsWith(`..${b.sep}`)||b.isAbsolute(i))return;o[s]=i.split(b.sep).join("/");}return o}function O(e){if(!Array.isArray(e.strategy))return;let t=structuredClone(e.strategy);if(!e.includeAbsolutePaths)for(let o of t)o.invocation&&(o.invocation.cwd=".");return t}function W(e){let t=Array.isArray(e.report.payload.projects)?e.report.payload.projects:e.report.payload.project?[e.report.payload.project]:[],o=new Set,s=[];for(let r of t){let i=m(r);if(!i)continue;let c=typeof i.name=="string"?i.name.trim():"",n=typeof i.path=="string"?i.path.trim():"";if(!c||!n)continue;let u=Array.isArray(i.repairCapabilities)?i.repairCapabilities:Array.isArray(i.probes)?i.probes.map(p=>m(p)?.repairCapability).filter(p=>p!==void 0):[];for(let p of u){let a=m(p),d=typeof a?.id=="string"?a.id.trim():"";if(!a||!d)continue;let f=`${c}:${d}`;if(o.has(f))continue;o.add(f);let h=a.risk==="safe"||a.risk==="guarded"||a.risk==="invasive"?a.risk:"guarded",g=N({capability:a,absoluteProjectPath:n,includeAbsolutePaths:e.includeAbsolutePaths}),l=a.status==="available"&&!!g,y=m(a.transaction),A=y?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone(y):void 0;A&&(A.projectPath=P(e.workspacePath,n,e.includeAbsolutePaths));let x=O({strategy:a.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),w=k(a.files).map(C=>P(e.workspacePath,C,e.includeAbsolutePaths)),R=g?s.find(C=>C.projectName===c&&C.command===g&&C.cwd==="project"):void 0;if(R){R.files=v([...R.files,...w]),R.notes=v([...R.notes,`Also satisfies Doctor capability: ${d}`]);continue}s.push(j({id:`doctor.${c}.${d}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof a.title=="string"&&a.title.trim()?a.title.trim():`Repair ${c}`,order:e.startOrder+s.length,phase:A?"dependency-remediation":"doctor-remediation",blocker:typeof a.reason=="string"&&a.reason.trim()?a.reason.trim():`Doctor remediation is pending for ${c}.`,summary:typeof a.reason=="string"&&a.reason.trim()?a.reason.trim():`Execute the Doctor-authored repair capability for ${c}.`,mode:l?a.canEditFiles===true?"edit-file":"run-command":"manual-guidance",risk:h,status:l?"ready":a.status==="manual"?"guidance-only":"blocked",...g?{command:g}:{},verifyCommand:typeof a.verifyCommand=="string"&&a.verifyCommand.trim()?a.verifyCommand.trim():"npx workspai doctor project --json",files:w,notes:[`Source Doctor capability: ${d}`,...k(a.limitations)],scope:"project",projectName:c,projectPath:P(e.workspacePath,n,e.includeAbsolutePaths),sourceStepId:d,strategy:x,transaction:A,cwd:"project",...a.operation?{rollback:{available:true,strategy:"manual"}}:{}}));}}return s}function J(e){let t=[],o=B("npx workspai bootstrap --json");for(let s of e.blockers)s.includes("profile.enterprise.ci")&&t.push(j({id:"bootstrap.enterprise-ci",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Run bootstrap in deterministic CI mode",order:10,phase:"bootstrap-preflight",blocker:s,summary:"Enterprise bootstrap compliance requires --ci for deterministic execution.",mode:"run-command",risk:"safe",command:o,verifyCommand:o})),s.includes("profile.enterprise.compatibility-matrix")&&t.push(j({id:"bootstrap.compatibility-matrix",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise compatibility matrix baseline",order:20,phase:"bootstrap-config",blocker:s,summary:"Create the missing compatibility matrix baseline without overwriting user data.",mode:"edit-file",risk:"safe",verifyCommand:o,files:[".workspai/compatibility-matrix.json"],operation:{type:"file-create",path:".workspai/compatibility-matrix.json",content:_(e.generatedAt),overwrite:false}})),s.includes("profile.enterprise.mirror-config")&&t.push(j({id:"bootstrap.mirror-config",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise mirror config baseline",order:30,phase:"bootstrap-config",blocker:s,summary:"Create the missing mirror configuration baseline without enabling mirroring.",mode:"edit-file",risk:"safe",verifyCommand:o,files:[".workspai/mirror-config.json"],operation:{type:"file-create",path:".workspai/mirror-config.json",content:z(e.generatedAt),overwrite:false}}));return t}function L(e){if(e.report.artifactKind==="readiness"&&/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(e.blocker))return j({id:`${e.report.cardId}.doctor-owner.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:"Resolve dependency vulnerability through Doctor",order:e.order,phase:"dependency-remediation",blocker:e.blocker,summary:"Release Readiness is the aggregate gate; use the project-scoped Doctor remediation capability that owns this dependency failure.",mode:"verify-before-fix",risk:"guarded",status:"review-required",command:"npx workspai doctor workspace --plan --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Read doctor-remediation-plan-last-run.json and execute the matching surface-security-hygiene capability before rerunning Readiness.","Do not treat a Readiness refresh as remediation for a source dependency vulnerability."]});let o={analyze:{title:"Refresh analyze evidence",phase:"analysis",command:"npx workspai analyze --strict --json",verify:"npx workspai analyze --strict --json"},readiness:{title:"Refresh release readiness",phase:"release-readiness",command:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",verify:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json"},pipeline:{title:"Rerun governance pipeline",phase:"governance-pipeline",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"},"workspace-run":{title:"Rerun failed workspace stage",phase:"fleet-run",command:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json",verify:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json"},"workspace-verify":{title:"Refresh workspace verify gate",phase:"verification",command:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",verify:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json"},"doctor-workspace":{title:"Use Doctor remediation plan",phase:"doctor-remediation",command:"npx workspai doctor workspace --plan --json",verify:"npx workspai doctor workspace --json"}}[e.report.artifactKind]??{title:"Refresh artifact evidence",phase:"evidence-refresh",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"};return j({id:`${e.report.cardId}.refresh.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:o.title,order:e.order,phase:o.phase,blocker:e.blocker,summary:"No deterministic file operation is available for this artifact yet; refresh the evidence and continue with the card-specific plan.",mode:e.report.artifactKind==="doctor-workspace"?"verify-before-fix":"run-command",risk:"guarded",status:e.report.artifactKind==="doctor-workspace"?"review-required":"ready",command:o.command,verifyCommand:o.verify,notes:e.report.artifactKind==="doctor-workspace"?["Read doctor-remediation-plan-last-run.json for ordered file-level steps."]:[]})}async function H(e){let t=[a(e,".workspai/reports"),b$1(e,".workspai/reports")],o=[],s=new Set;for(let r of T)for(let i of r.fileNames){let c=(await Promise.all(t.map(n=>b.join(n,i)))).find(n=>existsSync(n));if(!(!c||s.has(`${r.artifactKind}:${i}`))){s.add(`${r.artifactKind}:${i}`);try{let n=await E.readJSON(c),u=m(n);if(!u)continue;o.push({artifactKind:r.artifactKind,cardId:r.cardId,fileName:i,absolutePath:c,payload:u});break}catch{o.push({artifactKind:r.artifactKind,cardId:r.cardId,fileName:i,absolutePath:c,payload:{blockers:[`${r.artifactKind}: report exists but could not be parsed.`]}});break}}}return o}async function re(e){let t=b.resolve(e.workspacePath),o=e.includeAbsolutePaths===true,s=e.ciMode===true,r=new Date().toISOString(),i=a(t,".workspai/reports"),c=await H(t),n=[],u=1;for(let a of c){if(a.artifactKind==="doctor-workspace"){let y=Array.isArray(a.payload.steps)?q({report:a,workspacePath:t,includeAbsolutePaths:o,startOrder:u}):W({report:a,workspacePath:t,includeAbsolutePaths:o,startOrder:u});n.push(...y),u+=y.length;continue}let d=V(a);if(d.length===0)continue;if(a.artifactKind==="bootstrap-compliance"){n.push(...J({blockers:d,generatedAt:r})),u=n.length+1;continue}let f=n.some(y=>y.transaction?.kind==="dependency-security"),h=a.artifactKind==="readiness"&&d.some(y=>/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(y));if(f&&h)continue;let g=d[0],l=L({report:a,blocker:g,order:u,ciMode:s});d.length>1&&l.notes.push(...d.slice(1,8).map(y=>`Related blocker: ${y}`)),n.push(l),u+=1;}let p={safe:n.filter(a=>a.risk==="safe").length,guarded:n.filter(a=>a.risk==="guarded").length,invasive:n.filter(a=>a.risk==="invasive").length};return {schemaVersion:a$1,generatedAt:r,workspace:{name:b.basename(t),...o?{path:t}:{}},source:{command:"workspace remediation-plan",reportsDir:P(t,i,o),includeAbsolutePaths:o,ciMode:s},summary:{artifactsScanned:c.length,cardsCovered:v(n.map(a=>a.cardId)).length,totalActions:n.length,executableActions:n.filter(a=>a.status==="ready").length,risk:p},actions:n}}async function ae(e$1,t){return e(t,".workspai/reports/artifact-remediation-plan-last-run.json",e$1)}export{re as buildArtifactRemediationPlan,ae as writeArtifactRemediationPlan};
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-FRJYAJH6.js';
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-GR6442P7.js';import {j,a,b as b$1,t}from'./chunk-MOSXTVPU.js';import {promises}from'fs';import c from'path';var v=new Set(["node_modules","dist","build","target","coverage","htmlcov",".workspai",".rapidkit",".venv"]);function b(t,r){if(r.has(t)||a$1(t))return true;let i=t.toLowerCase();return !!(i==="dist"||i.startsWith("dist-")||i.startsWith("dist_")||i==="build"||i.startsWith("build-")||i.startsWith("build_"))}async function D(t){try{return await promises.access(t),true}catch{return false}}async function w(t$1){for(let r of t(t$1,"context.json"))if(await D(r))return true;for(let r of t(t$1,"project.json"))if(await D(r))return true;return false}async function M(t,r){let i=[],o=[c.resolve(t)],u=new Set,P=r?.skipDirs??v,g=r?.includeHiddenDirs===true,y=r?.descendIntoMatchedProjects!==false,j$1=r?.isProjectDir??w,d=c.resolve(t);for(;o.length>0;){let e=o.shift();if(!e||u.has(e)||(u.add(e),e!==d&&j(e))||await j$1(e,d)&&(i.push(e),!y))continue;let s=[];try{s=await promises.readdir(e,{withFileTypes:true});}catch{continue}for(let n of s)n.isDirectory()&&(!g&&n.name.startsWith(".")||b(n.name,P)||n.name===a||n.name===b$1||o.push(c.join(e,n.name)));}return i.sort((e,s)=>e.localeCompare(s))}export{M as a};
@@ -0,0 +1,5 @@
1
+ import {a as a$1}from'./chunk-GR6442P7.js';import a from'fs';import o from'path';var f={nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["next","nextjs","next.js"],dependencyHints:["next"],scriptHints:["next dev","next build","next start"],fileHints:["next.config.js","next.config.mjs","next.config.ts"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"],dependencyHints:["@remix-run/react","@remix-run/node","@remix-run/dev"],scriptHints:["remix dev","remix vite:dev"],fileHints:["remix.config.js","remix.config.mjs"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"],dependencyHints:["nuxt","nuxt3"],scriptHints:["nuxt dev","nuxt build","nuxi dev","nuxi build"],fileHints:["nuxt.config.js","nuxt.config.ts","nuxt.config.mjs"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"],dependencyHints:["react","react-dom"],scriptHints:["react-scripts start","react-scripts build"],fileHints:[]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"],dependencyHints:["vite"],scriptHints:["vite","vite dev","vite build"],fileHints:["vite.config.js","vite.config.ts","vite.config.mjs"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"],dependencyHints:["vue","@vue/cli-service"],scriptHints:["vue-cli-service serve","vue-cli-service build"],fileHints:["vue.config.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"],dependencyHints:["@sveltejs/kit"],scriptHints:["svelte-kit dev","svelte-kit build"],fileHints:["svelte.config.js"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"],dependencyHints:["svelte"],scriptHints:["svelte"],fileHints:[]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"],dependencyHints:["@angular/core","@angular/cli"],scriptHints:["ng serve","ng build"],fileHints:["angular.json"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"],dependencyHints:["astro"],scriptHints:["astro dev","astro build"],fileHints:["astro.config.js","astro.config.ts","astro.config.mjs"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"],dependencyHints:["solid-js"],scriptHints:[],fileHints:[]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown frontend",supportTier:"observed",importStack:"unknown",aliases:["unknown"],dependencyHints:[],scriptHints:[],fileHints:[]}},L={nextjs:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},remix:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},nuxt:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},react:{dev:["dev","start"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vite:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vue:{dev:["dev","serve"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},sveltekit:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},svelte:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},angular:{dev:["start","serve"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},astro:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},solid:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function ne(e,n){let t=typeof e=="string"?h(e):e;return t==="unknown"?[]:L[t]?.[n]??[]}function _(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}function A(e){let n=_(o.join(e,"package.json"));if(!n)return {dependencies:{},scriptText:""};let t={...n.dependencies??{},...n.devDependencies??{},...n.peerDependencies??{}},i=n.scripts??{},s=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return {dependencies:t,scriptText:s}}function I(e,n){return n.some(t=>a.existsSync(o.join(e,t)))}function j(e){return e.vite?e.react||e["react-dom"]||e["@vitejs/plugin-react"]?"react":e.vue||e["@vitejs/plugin-vue"]?"vue":e.svelte||e["@sveltejs/vite-plugin-svelte"]?"svelte":e["solid-js"]||e["vite-plugin-solid"]?"solid":null:null}function p(e,n,t){let i=f[e]??f.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function te(e){return f[e]??f.unknown}function h(e){let n=(e??"").trim().toLowerCase().replace(/[_\s]+/g,"-");if(!n)return "unknown";for(let t of Object.values(f))if(t.aliases.includes(n))return t.key;return "unknown"}function N(e,n){let t=h(typeof n?.framework=="string"?n.framework:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0);if(t!=="unknown")return p(t,"high","framework");let{dependencies:i,scriptText:s}=A(e);for(let u of ["nextjs","remix","nuxt","sveltekit","angular","astro","vue","solid","vite","react","svelte"]){let d=f[u];if(d.dependencyHints.some(c=>i[c])){if(u==="vite"){let c=j(i);if(c)return p(c,"high","manifest")}return p(u,"high","manifest")}if(d.fileHints.length>0&&I(e,d.fileHints)){if(u==="vite"){let c=j(i);if(c)return p(c,"high","manifest")}return p(u,"high","manifest")}if(d.scriptHints.some(c=>s.includes(c)))return p(u,"medium","manifest")}return p("unknown","low","unknown")}var y={fastapi:{key:"fastapi",runtime:"python",displayName:"FastAPI",supportTier:"first-class",importStack:"fastapi",aliases:["fastapi"],kitPrefixes:["fastapi"]},django:{key:"django",runtime:"python",displayName:"Django",supportTier:"extended",importStack:"django",aliases:["django"]},flask:{key:"flask",runtime:"python",displayName:"Flask",supportTier:"extended",importStack:"flask",aliases:["flask"]},python:{key:"python",runtime:"python",displayName:"Python",supportTier:"observed",importStack:"unknown",aliases:["python"]},nestjs:{key:"nestjs",runtime:"node",displayName:"NestJS",supportTier:"first-class",importStack:"nestjs",aliases:["nestjs","nest"],kitPrefixes:["nestjs"]},nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["nextjs","next.js","next"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"]},express:{key:"express",runtime:"node",displayName:"Express",supportTier:"extended",importStack:"express",aliases:["express"]},fastify:{key:"fastify",runtime:"node",displayName:"Fastify",supportTier:"extended",importStack:"unknown",aliases:["fastify"]},koa:{key:"koa",runtime:"node",displayName:"Koa",supportTier:"extended",importStack:"koa",aliases:["koa"]},node:{key:"node",runtime:"node",displayName:"Node.js",supportTier:"observed",importStack:"unknown",aliases:["node","nodejs","typescript","javascript"]},gofiber:{key:"gofiber",runtime:"go",displayName:"Go/Fiber",supportTier:"extended",importStack:"go",aliases:["gofiber","fiber","go-fiber","go/fiber"],kitPrefixes:["gofiber"]},gogin:{key:"gogin",runtime:"go",displayName:"Go/Gin",supportTier:"extended",importStack:"go",aliases:["gogin","gin","go-gin","go/gin"],kitPrefixes:["gogin"]},echo:{key:"echo",runtime:"go",displayName:"Echo",supportTier:"extended",importStack:"go",aliases:["echo"]},go:{key:"go",runtime:"go",displayName:"Go",supportTier:"observed",importStack:"go",aliases:["go","golang"],kitPrefixes:["go"]},springboot:{key:"springboot",runtime:"java",displayName:"Spring Boot",supportTier:"extended",importStack:"springboot",aliases:["springboot","spring","spring-boot"],kitPrefixes:["springboot"]},java:{key:"java",runtime:"java",displayName:"Java",supportTier:"observed",importStack:"unknown",aliases:["java"]},laravel:{key:"laravel",runtime:"php",displayName:"Laravel",supportTier:"extended",importStack:"unknown",aliases:["laravel"]},symfony:{key:"symfony",runtime:"php",displayName:"Symfony",supportTier:"extended",importStack:"unknown",aliases:["symfony"]},php:{key:"php",runtime:"php",displayName:"PHP",supportTier:"observed",importStack:"unknown",aliases:["php"]},rails:{key:"rails",runtime:"ruby",displayName:"Ruby on Rails",supportTier:"extended",importStack:"rails",aliases:["rails","ruby-on-rails","ruby on rails"]},sinatra:{key:"sinatra",runtime:"ruby",displayName:"Sinatra",supportTier:"extended",importStack:"unknown",aliases:["sinatra"]},ruby:{key:"ruby",runtime:"ruby",displayName:"Ruby",supportTier:"observed",importStack:"unknown",aliases:["ruby"]},dotnet:{key:"dotnet",runtime:"dotnet",displayName:"ASP.NET Core",supportTier:"extended",importStack:"dotnet",aliases:["dotnet","asp.net","aspnet","asp.net core","csharp","c#"],kitPrefixes:["dotnet","aspnet","aspnetcore"]},actix:{key:"actix",runtime:"rust",displayName:"Actix-web",supportTier:"extended",importStack:"unknown",aliases:["actix","actix-web"]},axum:{key:"axum",runtime:"rust",displayName:"Axum",supportTier:"extended",importStack:"unknown",aliases:["axum"]},rocket:{key:"rocket",runtime:"rust",displayName:"Rocket",supportTier:"extended",importStack:"unknown",aliases:["rocket"]},rust:{key:"rust",runtime:"rust",displayName:"Rust",supportTier:"observed",importStack:"unknown",aliases:["rust"]},phoenix:{key:"phoenix",runtime:"elixir",displayName:"Phoenix",supportTier:"extended",importStack:"unknown",aliases:["phoenix"]},elixir:{key:"elixir",runtime:"elixir",displayName:"Elixir",supportTier:"observed",importStack:"unknown",aliases:["elixir"]},clojure:{key:"clojure",runtime:"clojure",displayName:"Clojure",supportTier:"extended",importStack:"unknown",aliases:["clojure"]},scala:{key:"scala",runtime:"scala",displayName:"Scala",supportTier:"extended",importStack:"unknown",aliases:["scala"]},kotlin:{key:"kotlin",runtime:"kotlin",displayName:"Kotlin",supportTier:"extended",importStack:"unknown",aliases:["kotlin"]},deno:{key:"deno",runtime:"deno",displayName:"Deno",supportTier:"extended",importStack:"unknown",aliases:["deno"]},bun:{key:"bun",runtime:"bun",displayName:"Bun",supportTier:"extended",importStack:"unknown",aliases:["bun"]},tauri:{key:"tauri",runtime:"node",displayName:"Tauri",supportTier:"extended",importStack:"unknown",aliases:["tauri","tauri-app"],kitPrefixes:["desktop.tauri"]},electron:{key:"electron",runtime:"node",displayName:"Electron",supportTier:"extended",importStack:"unknown",aliases:["electron","electron-forge"],kitPrefixes:["desktop.electron"]},"vscode-extension":{key:"vscode-extension",runtime:"node",displayName:"VS Code Extension",supportTier:"extended",importStack:"unknown",aliases:["vscode-extension","visual-studio-code-extension"],kitPrefixes:["extension.vscode"]},c:{key:"c",runtime:"c",displayName:"C",supportTier:"observed",importStack:"unknown",aliases:["c","clang","gcc"]},cpp:{key:"cpp",runtime:"cpp",displayName:"C++",supportTier:"observed",importStack:"unknown",aliases:["cpp","c++","cplusplus","cc","clang++","g++"]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown",supportTier:"observed",importStack:"unknown",aliases:["unknown"]}},B=new Map;for(let e of Object.values(y))for(let n of e.aliases)B.set(n,e.key);function r(e,n,t){let i=y[e]??y.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function R(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}function l(e){try{return a.existsSync(e)?a.readFileSync(e,"utf8").toLowerCase():""}catch{return ""}}function C(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}var O=new Set([".git",".hg",".svn",".workspai",".rapidkit",".venv","venv","node_modules","vendor","dist","build","target","coverage",".next",".cache"]);function b(e,n){if(n<0||!a.existsSync(e))return [];let t=[],i=[];try{i=a.readdirSync(e,{withFileTypes:true});}catch{return []}for(let s of i){let u=o.join(e,s.name);s.isDirectory()?t.push(...b(u,n-1)):t.push(u);}return t}function H(e,n){if(n<0||!a.existsSync(e))return [];let t=[];try{t=a.readdirSync(e,{withFileTypes:true});}catch{return []}let i=[];for(let s of t){let u=o.join(e,s.name);if(s.isDirectory()){if(O.has(s.name)||a$1(s.name))continue;i.push(...H(u,n-1));}else i.push(u);}return i}function m(e,n,t=2){return b(e,t).some(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function T(e,n,t=2){return b(e,t).filter(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function G(e){let n=R(e??"");if(!n)return "unknown";for(let t of Object.values(y))if(t.kitPrefixes?.some(i=>n.startsWith(i)))return t.key;return "unknown"}function g(e){return e?B.get(R(e))??"unknown":"unknown"}function de(e){return g(e)}function ce(e){let n=g(e);return n!=="unknown"?y[n].runtime:"unknown"}function V(e){let n=G(e.kitName);if(n!=="unknown")return r(n,"high","kit");let t=g(e.framework);if(t!=="unknown")return r(t,"high","framework");let i=g(e.runtime);return i!=="unknown"?r(i,"medium","runtime"):r("unknown","low","unknown")}function z(e){let n=C(o.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.scripts??{},s=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return t["@nestjs/core"]||s.includes("nest start")?r("nestjs","high","manifest"):t.express?r("express","high","manifest"):t.fastify?r("fastify","high","manifest"):t.koa?r("koa","high","manifest"):r("node","medium","marker")}function q(e){let n=C(o.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.engines??{},s=n.scripts??{},u=Object.values(s).filter(d=>typeof d=="string").join(" ").toLowerCase();return t["@tauri-apps/api"]||t["@tauri-apps/cli"]||a.existsSync(o.join(e,"src-tauri","Cargo.toml"))?r("tauri","high","manifest"):t.electron||t["@electron-forge/cli"]||u.includes("electron-forge")||u.includes("electron ")?r("electron","high","manifest"):typeof i.vscode=="string"&&(n.activationEvents!==void 0||n.contributes!==void 0)?r("vscode-extension","high","manifest"):r("unknown","low","unknown")}function M(e){let n=[l(o.join(e,"pyproject.toml")),l(o.join(e,"requirements.txt")),l(o.join(e,"requirements.in"))].join(`
2
+ `);return n.includes("fastapi")?r("fastapi","high","manifest"):n.includes("django")?r("django","high","manifest"):n.includes("flask")?r("flask","high","manifest"):n.trim()?r("python","medium","marker"):r("unknown","low","unknown")}function W(e){let n=[l(o.join(e,"go.mod")),l(o.join(e,"main.go"))].join(`
3
+ `);return n.includes("github.com/gofiber/fiber")?r("gofiber","high","manifest"):n.includes("github.com/gin-gonic/gin")?r("gogin","high","manifest"):n.includes("github.com/labstack/echo")?r("echo","high","manifest"):n.trim()?r("go","medium","marker"):r("unknown","low","unknown")}function P(e){let n=[l(o.join(e,"pom.xml")),l(o.join(e,"build.gradle")),l(o.join(e,"build.gradle.kts"))].join(`
4
+ `);return n.includes("spring-boot")||n.includes("org.springframework")?r("springboot","high","manifest"):n.trim()?r("java","medium","marker"):r("unknown","low","unknown")}function U(e){let n=l(o.join(e,"composer.json"));return n.includes("laravel/framework")?r("laravel","high","manifest"):n.includes("symfony/")?r("symfony","high","manifest"):n.trim()?r("php","medium","marker"):r("unknown","low","unknown")}function Y(e){let n=l(o.join(e,"Gemfile"));return n.includes("gem 'rails'")||n.includes('gem "rails"')?r("rails","high","manifest"):n.includes("gem 'sinatra'")||n.includes('gem "sinatra"')?r("sinatra","high","manifest"):n.trim()?r("ruby","medium","marker"):r("unknown","low","unknown")}function Q(e){let t=[...T(e,".csproj",3),...T(e,".sln",2)].map(i=>l(i)).join(`
5
+ `);return t.includes("microsoft.net.sdk.web")||t.includes("microsoft.aspnetcore")||t.includes("swashbuckle.aspnetcore")?r("dotnet","high","manifest"):t.trim()?r("dotnet","medium","marker"):r("unknown","low","unknown")}function X(e){let n=l(o.join(e,"Cargo.toml"));return n.includes("actix-web")?r("actix","high","manifest"):n.includes("axum")?r("axum","high","manifest"):n.includes("rocket")?r("rocket","high","manifest"):n.trim()?r("rust","medium","marker"):r("unknown","low","unknown")}function Z(e){let n=l(o.join(e,"mix.exs"));return n.includes("phoenix")?r("phoenix","high","manifest"):n.trim()?r("elixir","medium","marker"):r("unknown","low","unknown")}function $(e){let n=[],t=i=>{n.includes(i)||n.push(i);};return a.existsSync(o.join(e,"go.mod"))&&t("go"),(a.existsSync(o.join(e,"Cargo.toml"))||a.existsSync(o.join(e,"src-tauri","Cargo.toml")))&&t("rust"),(a.existsSync(o.join(e,"pom.xml"))||a.existsSync(o.join(e,"build.gradle"))||a.existsSync(o.join(e,"build.gradle.kts")))&&t("java"),a.existsSync(o.join(e,"mix.exs"))&&t("elixir"),a.existsSync(o.join(e,"composer.json"))&&t("php"),(m(e,".csproj")||m(e,".sln"))&&t("dotnet"),a.existsSync(o.join(e,"package.json"))&&t("node"),a.existsSync(o.join(e,"Gemfile"))&&t("ruby"),(a.existsSync(o.join(e,"pyproject.toml"))||a.existsSync(o.join(e,"setup.py"))||a.existsSync(o.join(e,"requirements.txt"))||a.existsSync(o.join(e,"requirements.in")))&&t("python"),(a.existsSync(o.join(e,"deps.edn"))||a.existsSync(o.join(e,"project.clj")))&&t("clojure"),a.existsSync(o.join(e,"build.sbt"))&&t("scala"),(a.existsSync(o.join(e,"deno.json"))||a.existsSync(o.join(e,"deno.jsonc")))&&t("deno"),(a.existsSync(o.join(e,"bun.lockb"))||a.existsSync(o.join(e,"bun.lock")))&&t("bun"),(a.existsSync(o.join(e,"CMakeLists.txt"))||a.existsSync(o.join(e,"meson.build"))||m(e,".cpp",3)||m(e,".cc",3)||m(e,".cxx",3)||m(e,".hpp",3)||m(e,".hh",3)||m(e,".hxx",3))&&t("cpp"),(m(e,".c",3)||m(e,".h",3))&&t("c"),(a.existsSync(o.join(e,"settings.gradle.kts"))||m(o.join(e,"src"),".kt",3))&&t("kotlin"),n}function le(e,n=4){let t=H(e,Math.max(0,Math.min(12,n))),i=new Set(t.map(k=>o.basename(k))),s=t.map(k=>k.toLowerCase()),u=[],d=k=>{u.includes(k)||u.push(k);},c=(...k)=>k.some(w=>i.has(w)),x=(...k)=>s.some(w=>k.some(K=>w.endsWith(K)));return c("go.mod")&&d("go"),c("Cargo.toml")&&d("rust"),c("pom.xml","build.gradle","build.gradle.kts")&&d("java"),c("mix.exs")&&d("elixir"),c("composer.json")&&d("php"),x(".csproj",".sln")&&d("dotnet"),c("package.json")&&d("node"),c("Gemfile")&&d("ruby"),c("pyproject.toml","setup.py","requirements.txt","requirements.in")&&d("python"),c("deps.edn","project.clj")&&d("clojure"),c("build.sbt")&&d("scala"),c("deno.json","deno.jsonc")&&d("deno"),c("bun.lockb","bun.lock")&&d("bun"),(c("CMakeLists.txt","meson.build")||x(".cpp",".cc",".cxx",".hpp",".hh",".hxx"))&&d("cpp"),x(".c",".h")&&d("c"),(c("settings.gradle.kts")||x(".kt"))&&d("kotlin"),u}function me(e,n){let t=V({framework:typeof n?.framework=="string"?n.framework:void 0,runtime:typeof n?.runtime=="string"?n.runtime:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});if(t.key!=="unknown")return t;let i=$(e);if(i.includes("node")){let s=q(e);if(s.key!=="unknown")return s;let u=N(e,n);if(u.key!=="unknown")return u;let d=z(e);if(d.key!=="unknown")return d}if(i.includes("python")){let s=M(e);if(s.key!=="unknown")return s}if(i.includes("go")){let s=W(e);if(s.key!=="unknown")return s}if(i.includes("java")){let s=P(e);if(s.key!=="unknown")return s}if(i.includes("php")){let s=U(e);if(s.key!=="unknown")return s}if(i.includes("ruby")){let s=Y(e);if(s.key!=="unknown")return s}if(i.includes("rust")){let s=X(e);if(s.key!=="unknown")return s}if(i.includes("elixir")){let s=Z(e);if(s.key!=="unknown")return s}if(i.includes("dotnet")){let s=Q(e);if(s.key!=="unknown")return s}return i.includes("clojure")?r("clojure","medium","marker"):i.includes("scala")?r("scala","medium","marker"):i.includes("kotlin")?r("kotlin","medium","marker"):i.includes("deno")?r("deno","high","marker"):i.includes("bun")?r("bun","high","marker"):i.includes("cpp")?r("cpp","medium","marker"):i.includes("c")?r("c","medium","marker"):i.length>0?r(g(i[0]),"medium","runtime"):r("unknown","low","unknown")}export{ne as a,te as b,h as c,N as d,de as e,ce as f,V as g,$ as h,le as i,me as j};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-AHLMIL2T.js';var r=".workspai/skills";var e=a$1.skillsIndex,a=a$1.explain,_=".workspai/reports/workspace-why-last-run.json",c=".workspai/reports/workspace-trace-last-run.json",O=".workspai/AGENT-GROUNDING.md",P=".rapidkit/AGENT-GROUNDING.md",I=".cursor/rules/workspai-grounding.mdc",A=".cursor/rules/rapidkit-grounding.mdc",T=".claude/rules/workspai-evidence.md",E=".claude/rules/rapidkit-evidence.md",R=".github/instructions/workspai-workspace.instructions.md",L=".github/instructions/rapidkit-workspace.instructions.md",d=".github/instructions/workspai-evidence.instructions.md",S=".github/instructions/rapidkit-evidence.instructions.md",C=".github/prompts/workspai-diagnose.prompt.md",k=".github/prompts/rapidkit-diagnose.prompt.md",l=".github/prompts/workspai-repair.prompt.md",m=".github/prompts/rapidkit-repair.prompt.md",N=".github/prompts/workspai-release-readiness.prompt.md",u=".github/prompts/rapidkit-release-readiness.prompt.md",g=".github/prompts/workspai-project-onboard.prompt.md",K=".github/prompts/rapidkit-project-onboard.prompt.md",G=".github/prompts/workspai-adopt-project.prompt.md",w=".github/prompts/rapidkit-adopt-project.prompt.md",x=".github/skills/workspai-grounding/SKILL.md",H=".github/skills/rapidkit-grounding/SKILL.md",D=".github/skills/workspai-workspace-intelligence/SKILL.md",W=".github/skills/rapidkit-workspace-intelligence/SKILL.md",h=".workspai/reports/workspai-mcp-design.json",U=".workspai/reports/rapidkit-mcp-design.json",b=".vscode/workspai-agent-hooks.json",Y=".vscode/rapidkit-agent-hooks.json";function M(t){let s=t.trim();if(!s||s.includes("..")||s.includes("/"))throw new Error(`Invalid operational skill id: ${t}`);return `${r}/${s}.md`}var f={"workspai-diagnose-api-failure":"workspai-diagnose","workspai-release-readiness":"workspai-release-readiness","workspai-safe-schema-migration":"workspai-safe-schema-migration","workspai-dependency-upgrade":"workspai-dependency-upgrade","workspai-rename-contract":"workspai-rename-contract"};export{H as A,D as B,W as C,h as D,U as E,b as F,Y as G,M as H,f as I,r as a,e as b,a as c,_ as d,c as e,O as f,P as g,I as h,A as i,T as j,E as k,R as l,L as m,d as n,S as o,C as p,k as q,l as r,m as s,N as t,u,g as v,K as w,G as x,w as y,x as z};
1
+ import {a as a$1}from'./chunk-62K2H72S.js';var r=".workspai/skills";var e=a$1.skillsIndex,a=a$1.explain,_=".workspai/reports/workspace-why-last-run.json",c=".workspai/reports/workspace-trace-last-run.json",O=".workspai/AGENT-GROUNDING.md",P=".rapidkit/AGENT-GROUNDING.md",I=".cursor/rules/workspai-grounding.mdc",A=".cursor/rules/rapidkit-grounding.mdc",T=".claude/rules/workspai-evidence.md",E=".claude/rules/rapidkit-evidence.md",R=".github/instructions/workspai-workspace.instructions.md",L=".github/instructions/rapidkit-workspace.instructions.md",d=".github/instructions/workspai-evidence.instructions.md",S=".github/instructions/rapidkit-evidence.instructions.md",C=".github/prompts/workspai-diagnose.prompt.md",k=".github/prompts/rapidkit-diagnose.prompt.md",l=".github/prompts/workspai-repair.prompt.md",m=".github/prompts/rapidkit-repair.prompt.md",N=".github/prompts/workspai-release-readiness.prompt.md",u=".github/prompts/rapidkit-release-readiness.prompt.md",g=".github/prompts/workspai-project-onboard.prompt.md",K=".github/prompts/rapidkit-project-onboard.prompt.md",G=".github/prompts/workspai-adopt-project.prompt.md",w=".github/prompts/rapidkit-adopt-project.prompt.md",x=".github/skills/workspai-grounding/SKILL.md",H=".github/skills/rapidkit-grounding/SKILL.md",D=".github/skills/workspai-workspace-intelligence/SKILL.md",W=".github/skills/rapidkit-workspace-intelligence/SKILL.md",h=".workspai/reports/workspai-mcp-design.json",U=".workspai/reports/rapidkit-mcp-design.json",b=".vscode/workspai-agent-hooks.json",Y=".vscode/rapidkit-agent-hooks.json";function M(t){let s=t.trim();if(!s||s.includes("..")||s.includes("/"))throw new Error(`Invalid operational skill id: ${t}`);return `${r}/${s}.md`}var f={"workspai-diagnose-api-failure":"workspai-diagnose","workspai-release-readiness":"workspai-release-readiness","workspai-safe-schema-migration":"workspai-safe-schema-migration","workspai-dependency-upgrade":"workspai-dependency-upgrade","workspai-rename-contract":"workspai-rename-contract"};export{H as A,D as B,W as C,h as D,U as E,b as F,Y as G,M as H,f as I,r as a,e as b,a as c,_ as d,c as e,O as f,P as g,I as h,A as i,T as j,E as k,R as l,L as m,d as n,S as o,C as p,k as q,l as r,m as s,N as t,u,g as v,K as w,G as x,w as y,x as z};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-2OIBHUVH.js';import {a as a$1}from'./chunk-GR6442P7.js';import {f,e}from'./chunk-MBRU3VWJ.js';import {createHash}from'crypto';import c from'path';import {execa}from'execa';import u from'fs-extra';var L="workspai.project-test-coverage.v1",k=".workspai/reports/project-test-coverage-last-run.json",I=["package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deps.edn","project.clj","build.sbt","CMakeLists.txt","meson.build","deno.json","deno.jsonc"];function p(e){let t=Number(e);return Number.isFinite(t)&&t>=0?t:0}function g(e,t,o=0){let n=p(e),r=Math.min(p(t),n),i=p(o);return {total:n,covered:r,skipped:i,percent:n>0?Math.round(r/n*1e4)/100:null}}function S(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;return g(t.total,t.covered,t.skipped)}function y(e,t){let o=c.isAbsolute(t)?t:c.resolve(e,t),n=c.relative(e,o);return n&&!n.startsWith("..")?n.split(c.sep).join("/"):t}async function x(e){return createHash("sha256").update(await u.readFile(e)).digest("hex")}async function $(e){let t=c.resolve(e);for(;;){if(await u.pathExists(c.join(t,".workspai","project.json"))||await u.pathExists(c.join(t,".rapidkit","project.json"))||(await Promise.all(I.map(r=>u.pathExists(c.join(t,r))))).some(Boolean))return t;let n=c.dirname(t);if(n===t)return c.resolve(e);t=n;}}async function V(e){if(await u.pathExists(c.join(e,"deno.json"))||await u.pathExists(c.join(e,"deno.jsonc")))return "deno";if(await u.pathExists(c.join(e,"bun.lock"))||await u.pathExists(c.join(e,"bun.lockb")))return "bun";if(await u.pathExists(c.join(e,"package.json")))return "node";if(await u.pathExists(c.join(e,"pyproject.toml"))||await u.pathExists(c.join(e,"requirements.txt")))return "python";if(await u.pathExists(c.join(e,"go.mod")))return "go";let t=await u.pathExists(c.join(e,"pom.xml"))||await u.pathExists(c.join(e,"build.gradle"))||await u.pathExists(c.join(e,"build.gradle.kts"));return t&&(await P(e,o=>o.endsWith(".kt")||o.endsWith(".kts")&&o!=="build.gradle.kts"&&o!=="settings.gradle.kts",4)).length>0?"kotlin":t?"java":await u.pathExists(c.join(e,"Cargo.toml"))?"rust":await u.pathExists(c.join(e,"composer.json"))?"php":await u.pathExists(c.join(e,"Gemfile"))?"ruby":await u.pathExists(c.join(e,"mix.exs"))?"elixir":await u.pathExists(c.join(e,"deps.edn"))||await u.pathExists(c.join(e,"project.clj"))?"clojure":await u.pathExists(c.join(e,"build.sbt"))?"scala":await u.pathExists(c.join(e,"CMakeLists.txt"))?(await P(e,n=>/\.(c|cc|cpp|cxx)$/.test(n),3)).some(n=>/\.(cc|cpp|cxx)$/.test(n))?"cpp":"c":(await P(e,o=>/\.(sln|csproj)$/.test(o),2)).length>0?"dotnet":"unknown"}async function P(e,t,o=5){let n=[],r=[{dir:e,depth:0}],i=new Set([".git",".workspai",".rapidkit","node_modules",".venv","vendor","deps"]);for(;r.length>0;){let s=r.shift();if(!s)break;let a=await u.readdir(s.dir,{withFileTypes:true}).catch(()=>[]);for(let l of a){if(i.has(l.name)||a$1(l.name))continue;let d=c.join(s.dir,l.name),m=c.relative(e,d).split(c.sep).join("/");l.isFile()&&t(l.name,m)&&n.push(d),l.isDirectory()&&s.depth<o&&r.push({dir:d,depth:s.depth+1});}}return n}async function W(e,t){let o=await u.readJson(t),n=o.total??o,r={};for(let s of ["lines","branches","functions","statements"]){let a=S(n[s]);a&&(r[s]=a);}let i=[];for(let[s,a]of Object.entries(o)){if(s==="total"||!a||typeof a!="object"||Array.isArray(a))continue;let l=a,d={};for(let m of ["lines","branches","functions","statements"]){let b=S(l[m]);b&&(d[m]=b);}i.push({path:y(e,s),metrics:d});}return {metrics:r,files:i,source:{format:"istanbul-json",path:t,sha256:await x(t)}}}async function H(e,t){let o=await u.readJson(t),n=o.totals??{},r={lines:g(n.num_statements,n.covered_lines)};p(n.num_branches)>0&&(r.branches=g(n.num_branches,n.covered_branches));let i=[];for(let[s,a]of Object.entries(o.files??{})){let l=a?.summary??{};i.push({path:y(e,s),metrics:{lines:g(l.num_statements,l.covered_lines),...p(l.num_branches)>0?{branches:g(l.num_branches,l.covered_branches)}:{}}});}return {metrics:r,files:i,source:{format:"coverage-py-json",path:t,sha256:await x(t)}}}function j(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,o=p(t.count),n=p(t.covered);return o>0?g(o,n):void 0}async function D(e,t){let o=await u.readJson(t),n=Array.isArray(o.data)?o.data[0]??{}:o,r=n.totals??{},i={};i.lines=j(r.lines),i.functions=j(r.functions),i.branches=j(r.branches),i.statements=j(r.regions);let s=[];for(let a of Array.isArray(n.files)?n.files:[]){if(!a||typeof a!="object"||Array.isArray(a))continue;let l=a,d=l.summary??{};s.push({path:y(e,String(l.filename??"unknown")),metrics:{lines:j(d.lines),functions:j(d.functions),branches:j(d.branches),statements:j(d.regions)}});}return {metrics:i,files:s,source:{format:"llvm-cov-json",path:t,sha256:await x(t)}}}async function M(e,t){let o=await u.readFile(t,"utf8"),n=[],r="",i=0,s=0,a=0,l=0,d=0,m=0,b=v=>{r&&(n.push({path:y(e,r),metrics:{lines:g(v.lineTotal,v.lineCovered),functions:g(v.functionTotal,v.functionCovered),branches:g(v.branchTotal,v.branchCovered)}}),i+=v.lineTotal,s+=v.lineCovered,a+=v.functionTotal,l+=v.functionCovered,d+=v.branchTotal,m+=v.branchCovered);},h={lineTotal:0,lineCovered:0,functionTotal:0,functionCovered:0,branchTotal:0,branchCovered:0};for(let v of o.split(/\r?\n/))v.startsWith("SF:")?r=v.slice(3):v.startsWith("LF:")?h.lineTotal=p(v.slice(3)):v.startsWith("LH:")?h.lineCovered=p(v.slice(3)):v.startsWith("FNF:")?h.functionTotal=p(v.slice(4)):v.startsWith("FNH:")?h.functionCovered=p(v.slice(4)):v.startsWith("BRF:")?h.branchTotal=p(v.slice(4)):v.startsWith("BRH:")?h.branchCovered=p(v.slice(4)):v==="end_of_record"&&(b(h),r="",h={lineTotal:0,lineCovered:0,functionTotal:0,functionCovered:0,branchTotal:0,branchCovered:0});return {metrics:{lines:g(i,s),functions:g(a,l),branches:g(d,m)},files:n,source:{format:"lcov",path:t,sha256:await x(t)}}}async function G(e,t){let o=await u.readFile(t,"utf8"),n=new Map;for(let s of o.split(/\r?\n/).slice(1)){let a=/^(.+?):\d+\.\d+,\d+\.\d+\s+(\d+)\s+(\d+)$/.exec(s.trim());if(!a)continue;let l=n.get(a[1])??{total:0,covered:0},d=p(a[2]);l.total+=d,p(a[3])>0&&(l.covered+=d),n.set(a[1],l);}let r=[...n.entries()].map(([s,a])=>({path:y(e,s),metrics:{statements:g(a.total,a.covered)}})),i=[...n.values()].reduce((s,a)=>({total:s.total+a.total,covered:s.covered+a.covered}),{total:0,covered:0});return {metrics:{statements:g(i.total,i.covered)},files:r,source:{format:"go-coverprofile",path:t,sha256:await x(t)}}}function T(e,t){let n=[...e.matchAll(new RegExp(`<counter\\s+type=["']${t}["']\\s+missed=["'](\\d+)["']\\s+covered=["'](\\d+)["']\\s*\\/?\\s*>`,"gi"))].at(-1);return n?g(Number(n[1])+Number(n[2]),n[2]):void 0}async function C(e,t){let o=await u.readFile(e,"utf8"),n={};if(t==="cobertura-xml"){let r=/<coverage\b([^>]*)>/i.exec(o)?.[1]??"",i=/\bline-rate=["']([\d.]+)["']/i.exec(r)?.[1],s=/\bbranch-rate=["']([\d.]+)["']/i.exec(r)?.[1];i&&(n.lines=g(1e4,Math.round(Number(i)*1e4))),s&&(n.branches=g(1e4,Math.round(Number(s)*1e4)));}if(t==="clover-xml"){let i=[...o.matchAll(/<metrics\b([^>]*)\/?>/gi)].at(-1)?.[1]??"",s=m=>p(new RegExp(`\\b${m}=["'](\\d+)["']`,"i").exec(i)?.[1]),a=s("statements"),l=s("methods"),d=s("conditionals");a>0&&(n.statements=g(a,s("coveredstatements"))),l>0&&(n.functions=g(l,s("coveredmethods"))),d>0&&(n.branches=g(d,s("coveredconditionals")));}return n.lines??=T(o,"LINE"),n.branches??=T(o,"BRANCH"),n.functions??=T(o,"METHOD"),n.statements??=T(o,"INSTRUCTION"),{metrics:n,files:[],source:{format:t,path:e,sha256:await x(e)}}}async function q(e){let t=await u.readFile(e,"utf8"),o=/<scoverage\b([^>]*)>/i.exec(t)?.[1]??"",n=b=>p(new RegExp(`\\b${b}=["']([\\d.]+)["']`,"i").exec(o)?.[1]),r=n("statement-count"),i=n("statements-invoked"),s=n("branch-count"),a=n("branches-invoked"),l=n("statement-rate"),d=n("branch-rate"),m={};return r>0?m.statements=g(r,i):l>0&&(m.statements=g(1e4,Math.round(l*100))),s>0?m.branches=g(s,a):d>0&&(m.branches=g(1e4,Math.round(d*100))),{metrics:m,files:[],source:{format:"scoverage-xml",path:e,sha256:await x(e)}}}async function z(e,t){let o=await u.readJson(t),n=new Map;for(let s of Object.values(o)){let a=s?.coverage;if(!(!a||typeof a!="object"||Array.isArray(a)))for(let[l,d]of Object.entries(a)){if(!Array.isArray(d))continue;let m=n.get(l)??[];d.forEach((b,h)=>{typeof b=="number"&&(m[h]=Math.max(m[h]??0,b));}),n.set(l,m);}}let r=[...n.entries()].map(([s,a])=>{let l=a.filter(d=>typeof d=="number");return {path:y(e,s),metrics:{lines:g(l.length,l.filter(d=>d>0).length)}}}),i=r.reduce((s,a)=>{let l=a.metrics.lines;return {total:s.total+(l?.total??0),covered:s.covered+(l?.covered??0)}},{total:0,covered:0});return {metrics:{lines:g(i.total,i.covered)},files:r,source:{format:"simplecov-json",path:t,sha256:await x(t)}}}async function B(e){let t=[{relativePath:"coverage/coverage-summary.json",parser:r=>W(e,r)},{relativePath:"coverage.json",parser:async r=>{let i=await u.readJson(r);return Array.isArray(i.data)?D(e,r):H(e,r)}},{relativePath:"coverage/lcov.info",parser:r=>M(e,r)},{relativePath:"cover/lcov.info",parser:r=>M(e,r)},{relativePath:"lcov.info",parser:r=>M(e,r)},{relativePath:"coverage.out",parser:r=>G(e,r)},{relativePath:"target/site/jacoco/jacoco.xml",parser:r=>C(r,"jacoco-xml")},{relativePath:"build/reports/jacoco/test/jacocoTestReport.xml",parser:r=>C(r,"jacoco-xml")},{relativePath:"coverage.xml",parser:r=>C(r,"clover-xml")},{relativePath:".resultset.json",parser:r=>z(e,r)}];for(let r of t){let i=c.join(e,r.relativePath);if(await u.pathExists(i))return r.parser(i)}let n=(await P(e,(r,i)=>r==="coverage.cobertura.xml"||r==="jacoco.xml"||r==="clover.xml"||r==="scoverage.xml"||i.endsWith("/coverage-summary.json"),7)).sort()[0];return n?n.endsWith("coverage-summary.json")?W(e,n):n.endsWith("jacoco.xml")?C(n,"jacoco-xml"):n.endsWith("coverage.cobertura.xml")?C(n,"cobertura-xml"):n.endsWith("scoverage.xml")?q(n):C(n,"clover-xml"):null}async function U(e){return u.readJson(c.join(e,"package.json")).catch(()=>null)}async function K(e,t){let o=(n,r)=>({cwd:e,executable:n,args:r});if(t==="node"||t==="bun"){let r=(await U(e))?.scripts??{},i=["test:coverage","test:cov","coverage"].find(a=>typeof r[a]=="string"),s=t==="bun"?"bun":await u.pathExists(c.join(e,"pnpm-lock.yaml"))?"pnpm":await u.pathExists(c.join(e,"yarn.lock"))?"yarn":"npm";if(i)return {runner:String(r[i]).split(/\s+/)[0]||s,invocations:[o(s,s==="yarn"?[i]:["run",i])],diagnostics:[]};if(typeof r.test=="string"){let a=s==="yarn"?["test","--coverage"]:s==="bun"?["test","--coverage","--coverage-reporter=lcov"]:["test","--","--coverage"];return {runner:String(r.test).split(/\s+/)[0]||s,invocations:[o(s,a)],diagnostics:[]}}return {runner:null,invocations:[],diagnostics:["No project-owned test or coverage script was detected."]}}if(t==="deno")return {runner:"deno",invocations:[o("deno",["test","--coverage=coverage"]),o("deno",["coverage","--lcov","--output=coverage/lcov.info","coverage"])],diagnostics:[]};if(t==="python")return {runner:"pytest-cov",invocations:[o(await u.pathExists(c.join(e,".venv",process.platform==="win32"?"Scripts":"bin",process.platform==="win32"?"python.exe":"python"))?c.join(".venv",process.platform==="win32"?"Scripts":"bin",process.platform==="win32"?"python.exe":"python"):process.platform==="win32"?"python":"python3",["-m","pytest","--cov=.","--cov-report=json:coverage.json"])],diagnostics:[]};if(t==="go")return {runner:"go test",invocations:[o("go",["test","./...","-coverprofile=coverage.out"])],diagnostics:[]};if(t==="java"){let n=await u.pathExists(c.join(e,"gradlew")),r=await u.pathExists(c.join(e,"gradlew.bat")),i=n||r,s=await u.pathExists(c.join(e,"mvnw")),a=await u.pathExists(c.join(e,"mvnw.cmd")),l=i?process.platform==="win32"&&r?".\\gradlew.bat":"./gradlew":await u.pathExists(c.join(e,"pom.xml"))?process.platform==="win32"&&a?".\\mvnw.cmd":s?"./mvnw":"mvn":"gradle";return {runner:i?"jacoco/gradle":"jacoco/maven",invocations:[o(l,i?["test","jacocoTestReport"]:["test","jacoco:report"])],diagnostics:[]}}return t==="dotnet"?{runner:"dotnet coverlet",invocations:[o("dotnet",["test","--collect:XPlat Code Coverage"])],diagnostics:[]}:t==="rust"?{runner:"cargo llvm-cov",invocations:[o("cargo",["llvm-cov","--json","--output-path","coverage.json"])],diagnostics:["cargo-llvm-cov must be available in the project toolchain."]}:t==="php"?{runner:"phpunit",invocations:[o(process.platform==="win32"?"vendor\\bin\\phpunit.bat":"vendor/bin/phpunit",["--coverage-clover","coverage.xml"])],diagnostics:[]}:t==="ruby"?{runner:"simplecov",invocations:[o("bundle",["exec","rspec"])],diagnostics:["The test suite must enable SimpleCov to emit .resultset.json."]}:t==="elixir"?{runner:"mix cover",invocations:[o("mix",["test","--cover"])],diagnostics:["Configure ExCoveralls for JSON or LCOV interchange when machine-readable coverage is required."]}:t==="clojure"?{runner:"cloverage",invocations:[o("clojure",["-M:coverage"])],diagnostics:["The project must declare a coverage alias such as cloverage."]}:t==="scala"?{runner:"sbt-scoverage",invocations:[o("sbt",["clean","coverage","test","coverageReport"])],diagnostics:["The project must declare the scoverage plugin."]}:t==="kotlin"?{runner:"jacoco/gradle",invocations:[o(await u.pathExists(c.join(e,process.platform==="win32"?"gradlew.bat":"gradlew"))?process.platform==="win32"?".\\gradlew.bat":"./gradlew":"gradle",["test","jacocoTestReport"])],diagnostics:["The project must declare the JaCoCo Gradle plugin."]}:t==="c"||t==="cpp"?{runner:"CTest/LLVM coverage",invocations:[o("ctest",["--test-dir","build","--output-on-failure"])],diagnostics:["The native build must be instrumented for coverage and export LCOV, Cobertura, or LLVM JSON evidence."]}:{runner:null,invocations:[],diagnostics:["Project runtime could not be detected."]}}function X(e,t){let o=e?c.relative(e,t).split(c.sep).join("/"):c.resolve(t),n=c.basename(t).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"project",r=createHash("sha256").update(o).digest("hex").slice(0,12);return `${n}--${r}`}function Q(e){return e.lines?"lines":e.statements?"statements":e.branches?"branches":"functions"}async function ie(e$1={}){let t=await $(e$1.projectPath??process.cwd()),o=a(t),n=await V(t),r=Math.max(0,Math.min(100,Math.round(e$1.target??80))),i=await K(t,n),s=[],a$1=Date.now();if(e$1.run)for(let f of i.invocations){let w=await execa(f.executable,f.args,{cwd:f.cwd,reject:false,timeout:6e5}).catch(()=>({exitCode:1}));if(s.push(Number(w.exitCode??1)),Number(w.exitCode??1)!==0)break}let l=await B(t).catch(()=>null),d=l?Q(l.metrics):"lines",m=l?.metrics[d]?.percent??null,b=e$1.run&&s.some(f=>f!==0)?"failed":m===null?"unavailable":m>=r?"passed":"below-target",h=X(o,t),v=c.join(t,k),E=o?`.workspai/reports/projects/${h}/project-test-coverage-last-run.json`:null,R={schemaVersion:L,generatedAt:new Date().toISOString(),status:b,project:{id:h,name:c.basename(t),path:t,workspacePath:o},runtime:n,runner:i.runner,target:{metric:d,percent:r},metrics:l?.metrics??{},files:l?.files??[],lowCoverageFiles:(l?.files??[]).map(f=>{let w=f.metrics[d]??f.metrics.lines??f.metrics.statements;return {path:f.path,percent:w?.percent??null,uncovered:Math.max(0,(w?.total??0)-(w?.covered??0))}}).filter(f=>f.percent===null||f.percent<r).sort((f,w)=>w.uncovered-f.uncovered||f.path.localeCompare(w.path)),source:l?.source??{format:"unknown",path:null,sha256:null},execution:{requested:e$1.run===true,invocations:i.invocations,exitCodes:s,durationMs:Date.now()-a$1},diagnostics:[...i.diagnostics,...l?[]:["No supported machine-readable coverage artifact was found."]],artifactPaths:{project:v,workspaceLatest:o?c.join(o,k):null,workspaceProject:o&&E?c.join(o,E):null}};return o&&E&&await f(o,k,[{relativePath:k,payload:R},{relativePath:E,payload:R}]),await e(t,k,R),R}export{L as a,k as b,ie as c};
@@ -1 +1 @@
1
- import {b}from'./chunk-AHLMIL2T.js';var o="model-usage-event.v1",s=b.evaluationLive,a="workspace-intelligence-evaluation-comparison.v1",i=["provider-reported","tokenizer-counted","estimated","unavailable"];export{o as a,s as b,a as c,i as d};
1
+ import {b}from'./chunk-62K2H72S.js';var o="model-usage-event.v1",s=b.evaluationLive,a="workspace-intelligence-evaluation-comparison.v1",i=["provider-reported","tokenizer-counted","estimated","unavailable"];export{o as a,s as b,a as c,i as d};
@@ -0,0 +1,36 @@
1
+ import {b as b$4,a as a$1}from'./chunk-THIOE2PB.js';import {b as b$2,f as f$2,j,k,h as h$2,i,l,m,n,o,p as p$2,q,r,t,v,x,s as s$1,u as u$1,w,y,z,A,B,C,D,E,F,G,H as H$1,a as a$3,I}from'./chunk-3D3PFPP5.js';import {b as b$1,c,d as d$1}from'./chunk-WJY7ZXVJ.js';import {b as b$3}from'./chunk-LPCL4U4L.js';import {d as d$2}from'./chunk-XHRHNVCZ.js';import {h,g as g$1}from'./chunk-DZ4VKAXB.js';import {p,k as k$1,f as f$3}from'./chunk-FUPHQOJB.js';import {p as p$1}from'./chunk-B4CPDK6J.js';import {d}from'./chunk-MBRU3VWJ.js';import {a as a$2,b as b$5}from'./chunk-ULR66OJR.js';import {b,a}from'./chunk-62K2H72S.js';import {f,g,h as h$1}from'./chunk-MOSXTVPU.js';import s from'path';import f$1 from'fs-extra';var Q=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var kt="workspace-operational-skill.v1";function ft(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function Ze(e){let t=ft(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:kt,skillId:t,canonicalPath:H$1(t),title:e.title,triggers:[...e.triggers].sort((r,n)=>r.localeCompare(n)),requiredReports:[...e.requiredReports].sort((r,n)=>r.localeCompare(n)),scopedProjects:[...e.scopedProjects??[]].sort((r,n)=>r.localeCompare(n)),verificationCommands:[...e.verificationCommands],answerContractSections:[...Q],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var ht=b.skillsIndex;function Qe(e){let t=[...e.skills].sort((n,c)=>n.skillId.localeCompare(c.skillId)),r=e.inputsHash??f$3({skillIds:t.map(n=>n.skillId),paths:t.map(n=>n.canonicalPath)});return {schemaVersion:ht,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(n=>({skillId:n.skillId,path:n.canonicalPath,schemaVersion:n.schemaVersion,title:n.title}))}}var et=[a.agentIndex,b$1,d$2],wt=[{skillId:"workspai-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using Workspai evidence before editing application code.",steps:[`Read \`${a.agentIndex}\` and identify fail/warn reports for the scoped project.`,`Read \`${a.doctor}\`, \`doctor-project-last-run.json\`, and project-scoped run evidence if present.`,"If a fix was requested, read `artifact-remediation-plan-last-run.json` for cross-artifact next steps, then `doctor-remediation-plan-last-run.json` for Doctor-specific file edits.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."]},{skillId:"workspai-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed Workspai gates.",steps:[`Read \`${a.readiness}\` and \`pipeline-last-run.json\`.`,`Read \`${a.verify}\` for verdict and blocking reasons.`,"Read `.workspai/reports/artifact-remediation-plan-last-run.json` when a Studio or agent repair path is needed.","List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."]},{skillId:"workspai-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Require project-scoped test/build commands before promoting the migration.","Document rollback and verification signals."]},{skillId:"workspai-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Prefer workspace run test/build for affected projects.","Re-run `workspace verify` after evidence refresh."]},{skillId:"workspai-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:["Read `.workspai/workspace.contract.json` for publishes/consumes/owns edges.","List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."]}];function ee(e){return `npx workspai ${e}`.trim()}function At(e){let t=[`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",...et.map(r=>`- \`${r}\``),"","## Procedure","",...e.template.steps.map((r,n)=>`${n+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",ee("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
2
+ `)}function Pt(e){return e?.safeCommands?.length?e.safeCommands.slice(0,8).map(t=>t.display):[ee("workspace verify --json"),ee("doctor workspace --json")]}function Rt(e){return e?.projects?.length?e.projects.slice(0,12).map(r=>{let n=r.contracts?.owns?.join(", ")||"none",c=r.contracts?.publishes?.join(", ")||"none",l=r.contracts?.consumes?.join(", ")||"none";return `- **${r.slug}**: owns \`${n}\`; publishes \`${c}\`; consumes \`${l}\``}).join(`
3
+ `):void 0}function tt(e){let t=e.model.workspace.name,r=e.model.projects.map(l=>l.name).sort(),n=Pt(e.context??null),c=Rt(e.contract??null);return wt.map(l=>{let p=At({template:l,workspaceName:t,scopedProjects:r,verificationCommands:n,contractSummary:c});return Ze({skillId:l.skillId,title:l.title,triggers:l.triggers,requiredReports:[...et],scopedProjects:r,verificationCommands:n,promptStem:I[l.skillId],markdown:p})})}async function rt(e){let t=s.resolve(e.workspacePath),r=[],n=f$3({skills:e.skills.map(l=>({id:l.skillId,path:l.canonicalPath,hash:f$3({markdown:l.markdown})}))}),c=Qe({generatedAt:e.generatedAt,skills:e.skills,inputsHash:n});if(e.write){for(let p of e.skills){let o=s.join(t,p.canonicalPath);await f$1.ensureDir(s.dirname(o)),await f$1.writeFile(o,p.markdown,"utf8"),r.push(p.canonicalPath);}let l=s.join(t,b$2);await f$1.ensureDir(s.dirname(l)),await f$1.writeJson(l,c,{spaces:2}),r.push(b$2);}return {skills:e.skills,index:c,writtenPaths:r}}function nt(e){return ["## Operational skills (canonical)","","Read workspace-native playbooks from `.workspai/skills/` before generic repo scans. Legacy `.rapidkit/skills/` playbooks are read only when already present from older workspaces:","",...e.skills.map(r=>`- \`${r.path}\` \u2014 ${r.title} (\`${r.skillId}\`)`),"","Regenerate:","","```bash",ee("workspace agent-sync --write --refresh-context"),"```",""].join(`
4
+ `)}var St={"workspai-diagnose-api-failure":p$2,"workspai-release-readiness":t},xe="## Workspace verification (hydrated)";function yt(e){let t=[xe,"","Verification commands for this workspace:","",...e.verificationCommands.length?e.verificationCommands.map(r=>`- \`${r}\``):["- `npx workspai workspace verify --json`"]];return e.scopedProjects.length>0&&t.push("","Scoped projects:","",...e.scopedProjects.map(r=>`- ${r}`)),t.push(""),t.join(`
5
+ `)}async function at(e){let t=s.resolve(e.workspacePath),r=[];for(let n of e.skills){let c=St[n.skillId];if(!c)continue;let l=s.join(t,c);if(!await f$1.pathExists(l))continue;let p=await f$1.readFile(l,"utf8"),o=yt(n),A=p.includes(xe)?p.replace(new RegExp(`${xe}[\\s\\S]*$`),o.trimEnd()):`${p.trimEnd()}
6
+
7
+ ${o}`;e.write&&await f$1.writeFile(l,`${A.trimEnd()}
8
+ `,"utf8"),r.push(c);}return r}var Ct="workspai-agent-customization-pack-capabilities.v1";function ot(){return {schemaVersion:Ct,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[a.agentIndex,a.agentCustomizationPack,a.agents]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[a.agentIndex,a.agentCustomizationPack,a.agents,l,p$2,B,".github/agents/workspai-advisor.agent.md",D,b$2]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding for any agent.",outputFamilies:["portable"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},orca:{meaning:"Use AGENTS.md and the report index as the Orca/Grok grounding layer.",outputFamilies:["portable"]}},standardAnswerContract:[...Q],requiredReports:$.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".workspai/reports/",`${a$3}/`],l2PrefixedMirrorRoots:[".github/",".cursor/",".claude/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md"]}}}var xt=b.agentIndex,Et=b.agentCustomizationPack,H=a.agentIndex,K=a.agentCustomizationPack;var $=[{relativePath:b$1,label:"Agent context pack",required:true},{relativePath:b$2,label:"Operational skills index",required:true},{relativePath:a.model,label:"Workspace model",required:false},{relativePath:a.knowledgeGraph,label:"Workspace knowledge graph",required:false},{relativePath:a.evaluationLastRun,label:"Workspace Intelligence evaluation",required:false},{relativePath:a.doctor,label:"Workspace doctor",required:false},{relativePath:".workspai/reports/doctor-project-last-run.json",label:"Project doctor",required:false},{relativePath:".workspai/reports/doctor-remediation-plan-last-run.json",label:"Doctor remediation plan",required:false},{relativePath:".workspai/reports/artifact-remediation-plan-last-run.json",label:"Artifact remediation plan",required:false},{relativePath:".workspai/reports/doctor-fix-result-last-run.json",label:"Doctor fix result",required:false},{relativePath:a.analyze,label:"Workspace analyze",required:false},{relativePath:".workspai/reports/pipeline-last-run.json",label:"Governance pipeline",required:false},{relativePath:a.readiness,label:"Release readiness",required:false},{relativePath:a.impact,label:"Workspace impact",required:false},{relativePath:a.verify,label:"Workspace verify",required:false},{relativePath:a.snapshot,label:"Workspace model snapshot",required:false},{relativePath:a.diff,label:"Workspace model diff",required:false},{relativePath:a.explain,label:"Workspace explain",required:false},{relativePath:a.contractVerify,label:"Workspace contract verify",required:false},{relativePath:a.history,label:"Workspace intelligence history",required:false}];function It(){let e=$.map(n=>n.relativePath),r=b$3().consumers.agents.canonicalReadOrder.filter(n=>n!==H&&e.includes(n));return [...new Set([...r,...e])]}function P(e){return `npx workspai ${e}`.trim()}function be(e){return e&&typeof e=="object"?e:null}function Ee(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function Ot(e){let t=Ee(e.blockers,12);if(t.length>0)return t;let r=Ee(e.blockingReasons,12);if(r.length>0)return r;let n=be(e.summary);return n&&Array.isArray(n.blockingReasons)?Ee(n.blockingReasons,12):[]}function bt(e){let t=[...new Set(e.map(r=>r.trim()).filter(Boolean))];return t.filter(r=>{let n=r.toLowerCase();return !t.some(c=>{if(c===r||!c.includes(":"))return false;let l=c.toLowerCase();return l.length>n.length&&l.endsWith(n)})})}function _t(e){for(let t of ["generatedAt","updatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}if(Array.isArray(e.entries)){let t=e.entries.map(r=>be(r)?.generatedAt).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()).filter(r=>Number.isFinite(Date.parse(r)));if(t.length>0)return t.reduce((r,n)=>Date.parse(n)>Date.parse(r)?n:r)}}function Tt(e,t,r){if(!e)return true;let n=Date.parse(e);return Number.isFinite(n)?r.getTime()-n>t*60*60*1e3:true}function vt(e,t,r){return e.path===a.snapshot?false:Tt(e.generatedAt,t,r)}function Wt(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function S(e,t){return e.has("all")||e.has(t)}function jt(e){return S(e,"copilot")||S(e,"vscode")}function Lt(e){return e??"enterprise"}function Nt(e){return e===b$2?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":(e.startsWith(`${a$3}/`)||e.startsWith(".rapidkit/skills/"))&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e===F||e===G?"hook":e.includes("mcp")||e===D||e===E?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function Gt(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Dt(e,t){return ot().presets[t].requiredOutputs.includes(e)}async function $t(e,t){if(t)return t;let r=await d(e,k$1)??s.join(e,k$1);if(await f$1.pathExists(r))try{let n=await f$1.readJson(r);return b$5(k$1,n,r),n}catch{}return p({workspacePath:e,includeEvidence:true})}function Kt(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Ht(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(n=>n.targets.includes(r)).map(n=>n.path).sort()}]))}async function Mt(e,t){try{if(!await f$1.pathExists(e))return {payload:null,exists:false,validity:"missing"};let r=await f$1.readJson(e),n=be(r);return n?a$2(t)?(b$5(t,n,e),{payload:n,exists:true,validity:"valid"}):{payload:n,exists:true,validity:"uncontracted"}:{payload:null,exists:true,validity:"invalid",validationError:"Artifact root must be a JSON object"}}catch(r){return {payload:null,exists:true,validity:"invalid",validationError:r instanceof Error?r.message:String(r)}}}async function st(e){let t=e.now??new Date,r=e.staleAfterHours??24,n=[],c=[];for(let o of $){let A=await d(e.workspacePath,o.relativePath)??s.join(e.workspacePath,o.relativePath),h=await Mt(A,o.relativePath),g=h.payload;h.validity==="invalid"?c.push(`Invalid evidence contract: ${o.relativePath}`):g&&c.push(...Ot(g)),n.push({path:o.relativePath,label:o.label,required:o.required,exists:h.exists,validity:h.validity,validationError:h.validationError,generatedAt:g?_t(g):void 0,commandId:typeof g?.commandId=="string"?g.commandId:void 0,exitCode:typeof g?.exitCode=="number"?g.exitCode:void 0});}let l=bt(c).slice(0,16),p=b$3();return {schemaVersion:xt,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,intelligenceChain:{schemaVersion:p.schemaVersion,contractPath:p.contractPath,currentStep:"agent-sync"},readOrder:It(),blockers:l,staleAfterHours:r,reports:n,refreshCommand:P("workspace agent-sync --write --refresh-context")}}function it(e){let t=["# Workspai agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","",`1. \`${a.agentIndex}\` \u2014 latest blockers, timestamps, and report paths`,`2. \`${a.agentContext}\` \u2014 read only task-relevant context`,"3. Read only the task-relevant evidence artifacts listed in the index.","4. Use `workspace graph search <query> --limit 12 --json` or MCP `searchWorkspaceGraph` before loading the full graph.","","Do **not** full-repo scan or inject the complete graph when a bounded query can answer the task.","","## Regenerate intelligence","","```bash",P("workspace agent-sync --write --refresh-context"),P("workspace context --for-agent --json --write"),P("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t.push(`- ${r}`);t.push("");}if(e.context?.safeCommands?.length){t.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t.push(`- \`${r.display}\` \u2014 ${r.description}`);t.push("");}return t.push("## Rules","","- Treat `.workspai/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic Workspai CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.",""),t.join(`
9
+ `)}function qt(e){return ["# Workspai agent grounding","",`Generated: ${e.generatedAt}`,"",`This file is tool-agnostic. Synced agents should read it together with \`${a.agentIndex}\`.`,"","## Mandatory read order","",...e.readOrder.map((t,r)=>`${r+1}. \`${t}\``),"",e.blockers.length>0?"## Blockers":"",...e.blockers.length>0?e.blockers.map(t=>`- ${t}`):[],"","## Refresh","","```bash",e.refreshCommand,"```",""].filter(t=>t!=="").join(`
10
+ `)}function Vt(){return ["# Workspai workspace grounding","","Before answering workspace, release, or architecture questions:","","1. Read `AGENTS.md` (managed Workspai section).",`2. Read \`${a.agentIndex}\` and only task-relevant context from \`${a.agentContext}\`.`,"3. Use bounded `workspace graph search` or MCP `searchWorkspaceGraph` before scanning the full repository.","","Regenerate stale intelligence:","","```bash",P("workspace agent-sync --write --refresh-context"),"```",""].join(`
11
+ `)}function Ut(){return ["## Claude Code","",`- Load \`${a.agentIndex}\` before diagnosing blockers.`,"- Use `.claude/rules/workspai-evidence.md` for scoped Workspai evidence rules.","- Treat `.claude/rules/rapidkit-evidence.md` as a legacy compatibility mirror.","- Refresh grounding with `npx workspai workspace agent-sync --write`.",""].join(`
12
+ `)}function Ft(){return ["---","description: Workspai workspace evidence and intelligence grounding","globs: []","alwaysApply: true","---","","Before proposing fixes in this workspace:","",`1. Read \`${a.agents}\` and \`${a.agentIndex}\`.`,`2. Read only task-relevant context from \`${a.agentContext}\`.`,"3. Prefer bounded graph search and evidence reports over full-repo exploration.","","Refresh when stale:","","```bash",P("workspace agent-sync --write --refresh-context"),"```",""].join(`
13
+ `)}function zt(){return ["---",'applyTo: ".workspai/**,**/.workspai/**,.rapidkit/**,**/.rapidkit/**"',"description: Workspai evidence and intelligence artifacts","---","","When working under `.workspai/` or legacy `.rapidkit/`:","","- Treat `.workspai/reports/*` JSON reports as canonical gate and health evidence.",`- Start from \`${a.agentIndex}\` for read order and blockers.`,"- Do not invent pass/fail state \u2014 cite `exitCode`, `blockers`, and `generatedAt` fields.",""].join(`
14
+ `)}function Bt(){return ["---",'applyTo: "**"',"description: Workspai workspace scope, evidence, and command discipline","---","","# Workspai Workspace Intelligence","","Use Workspai reports as the workspace source of truth before giving architectural, repair, release, or project lifecycle advice.","","## Scope rules","",`- Start from \`${a.agentIndex}\`; read only task-relevant context and evidence.`,"- Prefer bounded `workspace graph search` or MCP `searchWorkspaceGraph` over loading the complete graph.","- Distinguish workspace-level blockers from project-level blockers.","- When a project is active, cite its name, path, framework, and evidence source.","- Do not translate unsupported stack requests into unrelated native kits.","","## Answer contract","","Return answers with: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
15
+ `)}function Jt(){return ["# Workspai evidence","","Applies when reading or editing `.workspai/reports/*`.","","- Start from `INDEX.json`, then `workspace-context-agent.json`.","- Use report blockers as the primary fix target.","- Regenerate with `npx workspai workspace agent-sync --write`.",""].join(`
16
+ `)}function Yt(){return ["# Legacy RapidKit evidence alias","","Compatibility path only. Use `.claude/rules/workspai-evidence.md` as the canonical rule.",""].join(`
17
+ `)}function Xt(){return ["---","description: Legacy RapidKit metadata compatibility alias",'globs: [".rapidkit/**", "**/.rapidkit/**"]',"alwaysApply: false","---","","Use `.cursor/rules/workspai-grounding.mdc` for canonical Workspai grounding.",""].join(`
18
+ `)}function ct(e){return ["---",'applyTo: ".rapidkit/**,**/.rapidkit/**"',"description: Legacy RapidKit metadata compatibility alias","---","",`Use \`.github/instructions/workspai-${e}.instructions.md\` as the canonical Workspai instruction.`,""].join(`
19
+ `)}function lt(){return ["---","description: Diagnose Workspai workspace blockers from evidence reports","---","","Diagnose this workspace using Workspai evidence only.","","Read:","",`- \`${a.agentIndex}\``,`- \`${a.agentContext}\``,"- Any fail/warn reports referenced in the index","","Return:","","1. Root cause grounded in report blockers","2. Smallest safe fix path (commands + file edits)","3. One verification command to prove recovery",""].join(`
20
+ `)}function te(e){return ["---",`description: ${e.description}`,"---","",e.objective,"","Read first:","",`- \`${a.agentIndex}\``,`- \`${a.agentContext}\``,"- Any report referenced by the current blocker or task","","Return:","",...e.expectedOutput.map((t,r)=>`${r+1}. ${t}`),"","Use the standard Workspai answer contract: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
21
+ `)}function T(e){return ["# "+e.title,"",...e.lines,""].join(`
22
+ `)}function Zt(){return T({title:"MCP Tool Design",lines:["Workspai MCP is a read-mostly bridge over contract-validated workspace artifacts.","","Candidate read tools:",`- \`getWorkspaceModel\` \u2014 read \`${a.model}\`.`,`- \`getWorkspaceKnowledgeGraph\` \u2014 read \`${a.knowledgeGraph}\`.`,`- \`getWorkspaceEvaluation\` \u2014 read \`${a.evaluationLastRun}\` (or the live evaluation when requested).`,"- `queryWorkspaceEntities` \u2014 filter proof-backed graph entities by kind.","- `searchWorkspaceGraph` \u2014 retrieve bounded proof-backed context by text query.","- `getWorkspaceGraphEvidence` \u2014 resolve evidence for an entity or relation.","- `findWorkspaceGraphPath` \u2014 find a shortest proof-carrying relationship path.",`- \`getEvidenceIndex\` \u2014 read \`${a.agentIndex}\`.`,"- `getBlockers` \u2014 derive current blockers from INDEX and gate reports.","- `getSafeCommands` \u2014 read safe commands from `workspace-context-agent.json`.","- `getProjectContext` \u2014 return one project-scoped slice of the workspace model.","- `getArtifact` \u2014 read one explicit artifact path inside the workspace root.",`- \`listOperationalSkills\` \u2014 read \`${a.skillsIndex}\`.`,"- `getWorkspaceExplain` \u2014 read/build workspace explain for release-blocked or project scope.","- `refreshWorkspaceIntelligence` \u2014 explicit user-approved refresh command only.","","Write or repair tools require explicit approval boundaries and are intentionally not part of the first read-mostly design."]})}function Qt(e){return `${JSON.stringify({schemaVersion:"workspai-mcp-design.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,status:"design-only",mode:"read-mostly",safety:{writeToolsEnabled:false,approvalRequiredForRefresh:true,artifactReadsMustStayInsideWorkspace:true},candidateTools:[{name:"getWorkspaceModel",reads:[a.model],mutates:false},{name:"getWorkspaceKnowledgeGraph",reads:[a.knowledgeGraph],mutates:false},{name:"getWorkspaceEvaluation",reads:[a.evaluationLive,a.evaluationLastRun],mutates:false},{name:"queryWorkspaceEntities",reads:[a.knowledgeGraph],mutates:false},{name:"searchWorkspaceGraph",reads:[a.knowledgeGraph],mutates:false},{name:"getWorkspaceGraphEvidence",reads:[a.knowledgeGraph],mutates:false},{name:"findWorkspaceGraphPath",reads:[a.knowledgeGraph],mutates:false},{name:"getEvidenceIndex",reads:[a.agentIndex],mutates:false},{name:"getBlockers",reads:[a.agentIndex,a.verify,".workspai/reports/pipeline-last-run.json"],mutates:false},{name:"getSafeCommands",reads:[a.agentContext],mutates:false},{name:"getProjectContext",reads:[a.model,a.agentContext],mutates:false},{name:"getArtifact",reads:["requested workspace-relative artifact path"],mutates:false},{name:"listOperationalSkills",reads:[a.skillsIndex],mutates:false},{name:"getWorkspaceExplain",reads:[a.explain,a.verify,a.impact],mutates:false},{name:"refreshWorkspaceIntelligence",command:P("workspace agent-sync --write --refresh-context"),mutates:true,approvalRequired:true}]},null,2)}
23
+ `}function er(e){return `${JSON.stringify({schemaVersion:"workspai-agent-hooks.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,enabledByDefault:false,mode:"advisory",hooks:[{name:"workspai-pre-tool-use-workspace-boundary",event:"PreToolUse",purpose:"Block or warn on state-changing commands outside the active workspace root.",defaultAction:"warn",rules:["Allow read-only commands.","Warn before write/delete commands outside workspaceRoot.","Never run destructive commands without explicit user approval."]},{name:"workspai-post-tool-use-verify-suggestion",event:"PostToolUse",purpose:"Suggest non-destructive verification commands after edits.",defaultAction:"suggest",commands:[P("doctor workspace"),P("workspace verify --strict --json")]},{name:"workspai-user-prompt-submit-scope-hint",event:"UserPromptSubmit",purpose:"Inject lightweight workspace scope and evidence index hints.",defaultAction:"inject-context-hint",reads:[a.agentIndex,a.agentContext]}]},null,2)}
24
+ `}function dt(e){let t=["---","name: workspai-workspace-intelligence","description: Use Workspai workspace intelligence reports to answer, repair, verify, and release with evidence","---","","# Workspai Workspace Intelligence","","Use this skill for workspace architecture, project lifecycle, blocker repair, release readiness, agent grounding, and CI evidence questions.","","## Decision flow","","1. Load `resources/scope-model.md`.",`2. Load \`${a.agentIndex}\`.`,`3. Load \`${a.agentContext}\`.`,`4. Load \`${a.skillsIndex}\` when operational playbooks are needed.`,"5. Load the smallest evidence report required for the task.","6. Answer with Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Rules","","- Prefer Workspai reports over full-repo scans.","- Never claim a gate passed without a cited report.","- Separate display commands from execution requests.","- Keep project-scoped fixes inside the active project unless workspace evidence says otherwise.",""];return e?.trim()&&t.push(e.trim(),""),t.join(`
25
+ `)}function re(e){return ["---",`name: ${e.name}`,`description: ${e.description}`,`tools: [${e.tools.map(t=>`'${t}'`).join(", ")}]`,"---","",`You are the ${e.name} agent for Workspai Workspace Intelligence.`,"",`Mode: ${e.mode}.`,"",`Start every task by reading \`${a.agentIndex}\` and \`${a.agentContext}\`.`,"","Use this answer contract:","","- Scope","- Evidence","- Diagnosis","- Fix Plan","- Run","- Verify","- Assumptions","","Do not invent health, readiness, or policy status. Cite report paths and command outputs.",""].join(`
26
+ `)}function pt(){return ["---","name: workspai-grounding","description: Load Workspai workspace intelligence reports before diagnosing or changing code","---","","# Workspai grounding","","Use when the user asks about workspace health, release gates, doctor/pipeline failures, or project structure.","","## Workflow","",`1. Read \`${a.agentIndex}\``,`2. Read \`${a.agentContext}\``,"3. Read fail/warn evidence artifacts listed in the index","4. Propose the smallest safe fix with explicit verification commands","","## Refresh stale evidence","","```bash",P("workspace agent-sync --write --refresh-context"),"```",""].join(`
27
+ `)}async function u(e,t,r){return r?(await f$1.ensureDir(s.dirname(e)),await f$1.writeFile(e,t,"utf8"),"written"):"skipped"}async function Ie(e){if(!e.write)return "skipped";let t=await f$1.pathExists(e.absolutePath)?await f$1.readFile(e.absolutePath,"utf8"):null,{upsertManagedAgentSection:r}=await import('./managed-agent-markers-COE5DJ3W.js'),n=r(t,e.generatedBody),c=e.preamble?`${e.preamble.trimEnd()}
28
+
29
+ ${n}`:n;return await f$1.ensureDir(s.dirname(e.absolutePath)),await f$1.writeFile(e.absolutePath,c,"utf8"),"written"}function zr(e){if(!e?.trim())return;let t=new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]),r=e.split(",").map(n=>n.trim().toLowerCase()).filter(n=>t.has(n));return r.length>0?r:void 0}function tr(e){let t=[...e.outputs].sort((n,c)=>n.path.localeCompare(c.path)),r=b$3();return {schemaVersion:Et,generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,preset:e.preset,targets:[...e.targets].sort(),sourceReports:e.index.reports.filter(n=>n.exists).map(n=>n.path).sort(),intelligenceChain:{schemaVersion:r.schemaVersion,contractPath:r.contractPath,currentStep:"agent-sync"},outputInventory:t,capabilityMatrix:Ht({targets:e.targets,outputs:t}),drift:{missingRequired:e.missingRequired,staleReports:e.staleReports,strictViolations:e.strictViolations},answerContract:["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"],refreshCommand:P(`workspace agent-sync --write --refresh-context --preset ${e.preset}`),experimental:{hooksEnabled:e.experimentalHooks,mcpReady:t.some(n=>n.kind==="mcp-design")}}}async function Oe(e){let t$1=s.resolve(e.workspacePath),r$1=e.now??new Date,n$1=e.staleAfterHours??24,c$1=Wt(e.targets),l$1=[...c$1].sort(),p$3=Lt(e.preset),o$1=e.write===true,A$1=e.strict===true,h,g=null,ne=e.model;e.refreshContext&&(ne??=await p({workspacePath:t$1,includeEvidence:true}),g=await c({workspacePath:t$1,model:ne,agent:e.agent??"generic",scope:e.scope,includeEvidence:true}),o$1&&(h=await d$1(g,t$1)));let b=[],ae=[],oe=[],se=[],d=(i,k)=>{i==="written"?ae.push(k):oe.push(k),se.push({path:k,kind:Nt(k),targets:Gt(k),required:Dt(k,p$3),status:i==="written"?"written":e.dryRun?"planned":"skipped"});},ie="",ut=await $t(t$1,ne),ce=null;try{ce=(await p$1({workspacePath:t$1})).contract;}catch{ce=null;}let gt=tt({model:ut,context:g,contract:ce}),le=await rt({workspacePath:t$1,skills:gt,generatedAt:r$1.toISOString(),write:o$1});for(let i of le.skills)d(o$1?"written":"skipped",i.canonicalPath);d(o$1?"written":"skipped",b$2),ie=nt(le.index);let y$1=await st({workspacePath:t$1,staleAfterHours:n$1,now:r$1});if(d(await u(s.join(t$1,H),`${JSON.stringify(y$1,null,2)}
30
+ `,o$1),H),d(await u(s.join(t$1,f$2),`${qt(y$1)}
31
+ `,o$1),f$2),(S(c$1,"agents")||S(c$1,"vscode"))&&d(await Ie({absolutePath:s.join(t$1,"AGENTS.md"),generatedBody:it({index:y$1,context:g}),write:o$1}),"AGENTS.md"),S(c$1,"claude")){let i=s.join(t$1,"CLAUDE.md");if(o$1){let{upsertManagedAgentSection:k}=await import('./managed-agent-markers-COE5DJ3W.js'),m=await f$1.pathExists(i)?await f$1.readFile(i,"utf8"):"",w=k(m,Ut()),C=w.includes("@AGENTS.md")?w:`@AGENTS.md
32
+
33
+ ${w}`;await f$1.ensureDir(s.dirname(i)),await f$1.writeFile(i,C,"utf8"),ae.push("CLAUDE.md");}else oe.push("CLAUDE.md");d(await u(s.join(t$1,j),`${Jt()}
34
+ `,o$1),j),d(await u(s.join(t$1,k),`${Yt()}
35
+ `,o$1),k);}if(S(c$1,"cursor")&&(d(await u(s.join(t$1,h$2),Ft(),o$1),h$2),d(await u(s.join(t$1,i),Xt(),o$1),i)),jt(c$1)){if(d(await Ie({absolutePath:s.join(t$1,".github/copilot-instructions.md"),generatedBody:Vt(),write:o$1}),".github/copilot-instructions.md"),d(await u(s.join(t$1,l),Bt(),o$1),l),d(await u(s.join(t$1,m),ct("workspace"),o$1),m),d(await u(s.join(t$1,n),zt(),o$1),n),d(await u(s.join(t$1,o),ct("evidence"),o$1),o),d(await u(s.join(t$1,p$2),lt(),o$1),p$2),d(await u(s.join(t$1,q),lt(),o$1),q),p$3==="enterprise"){let i=[[r,te({description:"Repair Workspai blockers with evidence and verification",objective:"Plan the smallest safe repair for the current Workspai blocker.",expectedOutput:["Blocker and affected workspace/project scope","Evidence paths and exact failing signals","Minimal fix plan","Human-run commands","Verification command and expected success signal"]})],[t,te({description:"Assess Workspai release readiness from evidence",objective:"Assess whether this workspace is release-ready using Workspai gates.",expectedOutput:["Readiness verdict with cited reports","Blocking gates","Safe next command","Verification checklist"]})],[v,te({description:"Onboard a project into Workspai Workspace Intelligence",objective:"Guide project onboarding using workspace model and create planner capabilities.",expectedOutput:["Target project scope","Native create, official generator, or existing lane","Safe commands","Post-onboarding verification"]})],[x,te({description:"Adopt an existing project into Workspai governance",objective:"Adopt an existing project without changing its runtime behavior.",expectedOutput:["Detected stack and confidence","Adoption plan","Generated metadata expectations","Doctor and workspace model verification"]})]];for(let[m,w]of i)d(await u(s.join(t$1,m),w,o$1),m);let k=[[s$1,i[0][1]],[u$1,i[1][1]],[w,i[2][1]],[y,i[3][1]]];for(let[m,w]of k)d(await u(s.join(t$1,m),w,o$1),m);if(e.hydratePrompts===true)for(let m of await at({workspacePath:t$1,skills:le.skills,write:o$1}))d(o$1?"written":"skipped",m);}if(d(await u(s.join(t$1,z),pt(),o$1),z),d(await u(s.join(t$1,A),pt(),o$1),A),p$3==="enterprise"){d(await u(s.join(t$1,B),dt(ie),o$1),B),d(await u(s.join(t$1,C),dt(ie),o$1),C);let i=[["artifact-map.md",T({title:"Artifact Map",lines:$.map(m=>`- \`${m.relativePath}\` \u2014 ${m.label}`)})],["command-map.md",T({title:"Command Map",lines:["- `npx workspai workspace agent-sync --write --refresh-context` \u2014 refresh agent grounding.","- `npx workspai workspace model --json --write` \u2014 refresh workspace model.","- `npx workspai doctor workspace` \u2014 refresh health evidence.","- `npx workspai workspace verify --strict --json` \u2014 verify release gates."]})],["scope-model.md",T({title:"Scope Model",lines:["- Workspace scope is the default source of truth.","- Project scope is selected only when the active task targets a specific project.","- Always name the workspace and project when giving repair or lifecycle advice."]})],["runtime-support.md",T({title:"Runtime Support",lines:["- Native create is available only for Workspai-owned scaffold contracts.","- Unsupported stacks should use the official lane when a stable ecosystem generator exists.","- Existing projects should use the existing lane when native create is unavailable."]})],["create-planner-capabilities.md",T({title:"Create Planner Capabilities",lines:["- Use `contracts/create-planner-capabilities.v1.json` to decide native, official, or existing.","- Do not map PHP, WordPress, Laravel, Rails, or Symfony requests to unrelated native kits.","- Explain unsupported native create requests and guide users to adopt/import."]})],["mcp-tools.md",Zt()]];for(let[m,w]of i){let C$1=`${s.dirname(B)}/resources/${m}`;d(await u(s.join(t$1,C$1),w,o$1),C$1);let Te=`${s.dirname(C)}/resources/${m}`;d(await u(s.join(t$1,Te),w,o$1),Te);}let k=[["workspai-advisor.agent.md",re({name:"Workspai Advisor",description:"Read-only workspace and project guidance using Workspai evidence",mode:"read-only",tools:["search","read"]})],["workspai-repair.agent.md",re({name:"Workspai Repair",description:"Turn Workspai blockers into minimal fixes and verification steps",mode:"repair",tools:["search","read","edit"]})],["workspai-release.agent.md",re({name:"Workspai Release",description:"Assess readiness, governance gates, and release safety from evidence",mode:"release",tools:["search","read"]})],["workspai-project-onboarder.agent.md",re({name:"Workspai Project Onboarder",description:"Guide create, import, and adopt flows with Workspai contracts",mode:"onboard",tools:["search","read","edit"]})]];for(let[m,w]of k){let C=`.github/agents/${m}`;d(await u(s.join(t$1,C),w,o$1),C);}}}if(p$3==="enterprise"){let i=Qt({workspacePath:t$1,generatedAt:y$1.generatedAt});b$5(D,JSON.parse(i)),d(await u(s.join(t$1,D),i,o$1),D),d(await u(s.join(t$1,E),i,o$1),E);}if(p$3==="enterprise"&&e.experimentalHooks===true){let i=er({workspacePath:t$1,generatedAt:y$1.generatedAt});b$5(F,JSON.parse(i)),d(await u(s.join(t$1,F),i,o$1),F),d(await u(s.join(t$1,G),i,o$1),G);}(S(c$1,"codex")||S(c$1,"orca"))&&(S(c$1,"agents")||d(await Ie({absolutePath:s.join(t$1,"AGENTS.md"),generatedBody:it({index:y$1,context:g}),write:o$1}),"AGENTS.md"));let de=o$1?await st({workspacePath:t$1,staleAfterHours:n$1,now:r$1}):y$1,M=de.reports.filter(i=>i.required&&!i.exists).map(i=>i.path),q$1=de.reports.filter(i=>i.exists&&vt(i,n$1,r$1)).map(i=>i.path);if(A$1){M.length>0&&b.push(`Missing required reports: ${M.join(", ")}`),q$1.length>0&&b.push(`Stale reports (>${n$1}h): ${q$1.join(", ")}`);let i=se.map(k=>k.path).filter(k=>!Kt(k));i.length>0&&b.push(`Unsafe generated output paths: ${i.join(", ")}`);}let V=o$1?await g$1({workspacePath:t$1,mode:e.projectGrounding??"managed",now:r$1}):void 0;A$1&&V&&V.skipped.length>0&&b.push(`Project grounding incomplete: ${V.skipped.map(i=>`${i.name} (${i.reason})`).join(", ")}`);let _e=tr({workspacePath:t$1,generatedAt:r$1.toISOString(),preset:p$3,targets:l$1,index:de,outputs:[...se,{path:K,kind:"report",targets:["agents","vscode","copilot","codex","orca"],required:true,status:o$1?"written":e.dryRun?"planned":"skipped"}],missingRequired:M,staleReports:q$1,strictViolations:b,experimentalHooks:e.experimentalHooks===true});if(o$1&&process.env.WORKSPAI_TEST_FAIL_AGENT_SYNC_BEFORE_PACK==="1")throw new Error("Injected agent-sync failure before generation commit.");return d(await u(s.join(t$1,K),`${JSON.stringify(_e,null,2)}
36
+ `,o$1),K),{workspacePath:t$1,indexPath:s.join(t$1,H),packPath:s.join(t$1,K),pack:_e,contextPath:h,writtenFiles:ae,skippedFiles:oe,blockers:y$1.blockers,missingRequired:M,staleReports:q$1,strictViolations:b,projectLenses:V}}async function Br(e){if(e.write!==true)return Oe(e);let t=s.resolve(e.workspacePath),r=s.join(t,".workspai","transactions","agent-sync");await b$4(r);let n=await Oe({...e,write:false,dryRun:true});if(!n.pack)throw new Error("Agent-sync dry run did not produce an output inventory.");let c=[...n.pack.outputInventory.map(p=>p.path),H,K],l=await a$1({journalDirectory:r});try{for(let A of [...new Set(c)].sort()){let h=s.resolve(t,A),g=s.relative(t,h);if(g===".."||g.startsWith(`..${s.sep}`)||s.isAbsolute(g))throw new Error(`Agent-sync output escapes workspace root: ${A}`);await l.captureFile(h);}let p=await h(t);for(let A of p.resolved)for(let h of [f,g,h$1,"AGENTS.md",".gitignore"])await l.captureFile(s.join(A.projectPath,h));let o=await Oe(e);return await l.commit(),o}catch(p){try{await l.rollback();}catch(o){throw new AggregateError([p,o],"Agent-sync generation failed and rollback was incomplete.")}throw p}}export{kt as a,ht as b,Ct as c,xt as d,Et as e,H as f,K as g,$ as h,It as i,st as j,zr as k,Br as l};
@@ -0,0 +1 @@
1
+ var o={model:".workspai/reports/workspace-model.json",knowledgeGraph:".workspai/reports/workspace-knowledge-graph.json",snapshot:".workspai/reports/workspace-model-snapshot.json",diff:".workspai/reports/workspace-model-diff-last-run.json",impact:".workspai/reports/workspace-impact-last-run.json",analyze:".workspai/reports/analyze-last-run.json",doctor:".workspai/reports/doctor-last-run.json",contractVerify:".workspai/reports/workspace-contract-verify-last-run.json",readiness:".workspai/reports/release-readiness-last-run.json",verify:".workspai/reports/workspace-verify-last-run.json",history:".workspai/reports/workspace-intelligence-history.json",agentContext:".workspai/reports/workspace-context-agent.json",agentIndex:".workspai/reports/INDEX.json",agentCustomizationPack:".workspai/reports/agent-customization-pack.json",skillsIndex:".workspai/reports/workspace-skills-index.json",agents:"AGENTS.md",explain:".workspai/reports/workspace-explain-last-run.json",intelligenceRun:".workspai/reports/workspace-intelligence-run-last-run.json",evaluationLive:".workspai/reports/workspace-intelligence-evaluation-live.json",evaluationLastRun:".workspai/reports/workspace-intelligence-evaluation-last-run.json",verifiedGoalStatus:".workspai/reports/verified-goal-last-run.json"},r={model:"workspace-model.v1",knowledgeGraph:"workspace-knowledge-graph.v1",snapshot:"workspace-model-snapshot.v1",diff:"workspace-model-diff.v1",impact:"workspace-impact.v1",analyze:"rapidkit-analyze-v1",doctor:"doctor-workspace-evidence-v1",contractVerify:"workspace-contract-verify.v1",readiness:"release-readiness-v1",verify:"workspace-verify.v1",history:"workspace-intelligence-history.v1",agentContext:"workspace-context.v1",agentIndex:"rapidkit-agent-reports-index.v1",agentCustomizationPack:"rapidkit-agent-customization-pack.v1",skillsIndex:"workspace-skills-index.v1",agents:null,explain:"workspace-explain.v1",intelligenceRun:"workspace-intelligence-run.v1",evaluationLive:"workspace-intelligence-evaluation.v1",evaluationLastRun:"workspace-intelligence-evaluation.v1",verifiedGoalStatus:"workspai.verified-goal-status.v1"},c={model:"contracts/workspace-intelligence/workspace-model.v1.json",knowledgeGraph:"contracts/workspace-intelligence/workspace-knowledge-graph.v1.json",snapshot:"contracts/workspace-intelligence/workspace-model-snapshot.v1.json",diff:"contracts/workspace-intelligence/workspace-model-diff.v1.json",impact:"contracts/workspace-intelligence/workspace-impact.v1.json",analyze:"contracts/analyze-last-run.v1.json",doctor:"contracts/doctor-workspace-evidence.v1.json",contractVerify:"contracts/workspace-intelligence/workspace-contract-verify.v1.json",readiness:"contracts/release-readiness.v1.json",verify:"contracts/workspace-intelligence/workspace-verify.v1.json",history:"contracts/workspace-intelligence/workspace-intelligence-history.v1.json",agentContext:"contracts/workspace-intelligence/workspace-context.v1.json",agentIndex:"contracts/workspace-intelligence/agent-reports-index.v1.json",agentCustomizationPack:"contracts/workspace-intelligence/agent-customization-pack-report.v1.json",skillsIndex:"contracts/workspace-intelligence/workspace-skills-index.v1.json",agents:null,explain:"contracts/workspace-intelligence/workspace-explain.v1.json",intelligenceRun:"contracts/workspace-intelligence/workspace-intelligence-run.v1.json",evaluationLive:"contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json",evaluationLastRun:"contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json",verifiedGoalStatus:"contracts/workspace-intelligence/verified-goal-status.v1.json"},i={analyze:"analyze",workspace:"workspace <action> [subaction] [key] [value]",doctor:"doctor [scope]",readiness:"readiness"},p=["analyze","readiness","doctor","workspace"],l=["model","diff","impact","doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence","verify","context","agent-sync","explain"],k=["sync","baseline"],d={sync:[".workspai/workspace.contract.json",".workspai/workspace-registry.v1.json"],baseline:[o.snapshot]},e=o,s={model:{command:["workspace","model","--json","--write"],produces:[e.model,e.knowledgeGraph]},diff:{command:["workspace","diff","--from",e.snapshot,"--json"],produces:[e.diff]},impact:{command:["workspace","impact","--from",e.diff,"--json"],produces:[e.impact]},"doctor-evidence":{command:["doctor","workspace","--json"],produces:[e.doctor]},"contract-evidence":{command:["workspace","contract","verify","--strict","--json"],produces:[e.contractVerify]},"analyze-evidence":{command:["analyze","--json"],produces:[e.analyze]},"readiness-evidence":{command:["readiness","--json","--skip-verify"],produces:[e.readiness]},verify:{command:["workspace","verify","--from-impact",e.impact,"--json"],produces:[e.verify,e.history]},context:{command:["workspace","context","--for-agent","--json","--write","--no-agent-sync"],produces:[e.agentContext]},"agent-sync":{command:["workspace","agent-sync","--write","--json","--preset","enterprise"],produces:[e.agentIndex,e.agentCustomizationPack,e.skillsIndex,e.agents]},explain:{command:["workspace","explain","release-blocked","--json","--write"],produces:[e.explain]}};function w(n){return s[n]}export{o as a,r as b,c,i as d,p as e,l as f,k as g,d as h,s as i,w as j};