@jstn-sdk/ma 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/.agents/plugins/marketplace.json +0 -0
  2. package/.codex/agents/Architect.toml +0 -2
  3. package/.codex/agents/Auditor.toml +0 -2
  4. package/.codex/agents/Builder.toml +0 -2
  5. package/.codex/agents/Flow.toml +0 -2
  6. package/.codex/agents/Sage.toml +0 -2
  7. package/.codex/agents/Vibe.toml +0 -2
  8. package/.codex/hooks.json +14 -13
  9. package/.codex/prompts/enforcement.md +4 -0
  10. package/.codex/prompts/skill-contract.md +4 -0
  11. package/COVERAGE.md +211 -0
  12. package/DEMO.md +265 -0
  13. package/README.md +159 -16
  14. package/bin/ma.js +219 -14
  15. package/data/clone-data.ledger.json +41 -0
  16. package/data/clone-data.proof.json +50 -0
  17. package/data/clone-data.rvf +37 -0
  18. package/docs/README.md +4 -1
  19. package/docs/assets/image/Screenshot(1).png +0 -0
  20. package/docs/assets/image/Screenshot(2).png +0 -0
  21. package/docs/assets/image/Screenshot(3).png +0 -0
  22. package/docs/assets/image/Screenshot(4).png +0 -0
  23. package/docs/assets/image/Screenshot(5).png +0 -0
  24. package/docs/assets/image/Screenshot(6).png +0 -0
  25. package/docs/assets/image/Screenshot(7).png +0 -0
  26. package/docs/assets/image/Screenshot(8).png +0 -0
  27. package/docs/assets/image/Screenshot(9).png +0 -0
  28. package/docs/assets/meta-architect-logo.png +0 -0
  29. package/docs/assets/meta-architect-logo.svg +0 -0
  30. package/docs/getting-started.md +38 -22
  31. package/docs/installed-sdk.md +0 -0
  32. package/docs/mcp-setup.md +35 -0
  33. package/docs/onboarding.md +18 -2
  34. package/docs/prompt-guidance-contract.md +17 -0
  35. package/docs/prompt-guidance-fragments/active-autonomy-core.md +7 -0
  36. package/docs/qa/release-issue-gates-0.1.13.json +644 -0
  37. package/docs/qa/{release-readiness-0.1.12.md → release-readiness-0.1.13.md} +25 -9
  38. package/docs/qa/release-readiness-0.1.5.md +1 -1
  39. package/docs/reference/native-engineering-patterns.md +0 -0
  40. package/docs/reference/native-security-playbooks.md +6 -0
  41. package/docs/reference/native-source-selection.md +6 -0
  42. package/docs/reference/native-style-and-deslop.md +0 -0
  43. package/docs/release-spec.md +25 -9
  44. package/docs/skills.md +14 -1
  45. package/index.js +222 -2
  46. package/mcp/collections.json +23 -6
  47. package/mcp/local/code-intel.js +0 -0
  48. package/mcp/local/memory.js +0 -0
  49. package/mcp/local/playbooks.js +0 -0
  50. package/mcp/local/state.js +0 -0
  51. package/mcp/local/team-run.js +48 -1
  52. package/mcp/local/trace.js +0 -0
  53. package/mcp/local-capabilities.json +0 -0
  54. package/mcp/native-playbooks.json +0 -0
  55. package/mcp/servers.json +24 -0
  56. package/package.json +5 -2
  57. package/plugins/meta-architect/.app.json +1 -1
  58. package/plugins/meta-architect/.codex-plugin/plugin.json +1 -1
  59. package/plugins/meta-architect/.mcp.json +1 -1
  60. package/plugins/meta-architect/README.md +8 -1
  61. package/plugins/meta-architect/obsidian/main.js +401 -0
  62. package/plugins/meta-architect/obsidian/manifest.json +9 -0
  63. package/plugins/meta-architect/obsidian/styles.css +7 -0
  64. package/plugins/meta-architect/skills/align/SKILL.md +0 -0
  65. package/plugins/meta-architect/skills/align/agents/openai.yaml +0 -0
  66. package/plugins/meta-architect/skills/align/references/shared-language.md +0 -0
  67. package/plugins/meta-architect/skills/arch/SKILL.md +2 -0
  68. package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
  69. package/plugins/meta-architect/skills/build/SKILL.md +3 -0
  70. package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -0
  71. package/plugins/meta-architect/skills/cleanup/SKILL.md +0 -0
  72. package/plugins/meta-architect/skills/cleanup/agents/openai.yaml +0 -0
  73. package/plugins/meta-architect/skills/cleanup/references/style-and-deslop.md +0 -0
  74. package/plugins/meta-architect/skills/diagnose/SKILL.md +0 -0
  75. package/plugins/meta-architect/skills/diagnose/agents/openai.yaml +0 -0
  76. package/plugins/meta-architect/skills/flow/SKILL.md +2 -0
  77. package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
  78. package/plugins/meta-architect/skills/maestro/SKILL.md +0 -0
  79. package/plugins/meta-architect/skills/maestro/agents/openai.yaml +0 -0
  80. package/plugins/meta-architect/skills/maestro/references/core-release-rules.md +0 -0
  81. package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +0 -0
  82. package/plugins/meta-architect/skills/sage/SKILL.md +2 -0
  83. package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
  84. package/plugins/meta-architect/skills/sage/references/source-selection.md +8 -0
  85. package/plugins/meta-architect/skills/tdd/SKILL.md +0 -0
  86. package/plugins/meta-architect/skills/tdd/agents/openai.yaml +0 -0
  87. package/plugins/meta-architect/skills/vet/SKILL.md +2 -0
  88. package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
  89. package/plugins/meta-architect/skills/vet/references/security-playbooks.md +7 -0
  90. package/plugins/meta-architect/skills/vibe/SKILL.md +2 -0
  91. package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
  92. package/scripts/active-autonomy-hook.mjs +96 -0
  93. package/scripts/biome-staged.js +0 -0
  94. package/scripts/build-linux-packages.mjs +0 -0
  95. package/scripts/doctor.js +17 -4
  96. package/scripts/install.sh +28 -0
  97. package/scripts/linux-package-lib.mjs +0 -0
  98. package/scripts/linux-package-smoke.mjs +0 -0
  99. package/scripts/plugin-sync.js +0 -0
  100. package/scripts/postinstall.js +0 -0
  101. package/scripts/ralph/prompt.md +35 -0
  102. package/scripts/release-metadata.js +0 -0
  103. package/scripts/release-sync.js +0 -0
  104. package/scripts/release-verify.js +166 -1
  105. package/scripts/setup-npmrc.js +0 -0
  106. package/skills/align/SKILL.md +0 -0
  107. package/skills/align/agents/openai.yaml +0 -0
  108. package/skills/align/references/shared-language.md +0 -0
  109. package/skills/arch/SKILL.md +2 -0
  110. package/skills/arch/agents/openai.yaml +0 -0
  111. package/skills/build/SKILL.md +3 -0
  112. package/skills/build/agents/openai.yaml +0 -0
  113. package/skills/cleanup/SKILL.md +0 -0
  114. package/skills/cleanup/agents/openai.yaml +0 -0
  115. package/skills/cleanup/references/style-and-deslop.md +0 -0
  116. package/skills/diagnose/SKILL.md +0 -0
  117. package/skills/diagnose/agents/openai.yaml +0 -0
  118. package/skills/flow/SKILL.md +2 -0
  119. package/skills/flow/agents/openai.yaml +0 -0
  120. package/skills/maestro/SKILL.md +0 -0
  121. package/skills/maestro/agents/openai.yaml +0 -0
  122. package/skills/maestro/references/core-release-rules.md +0 -0
  123. package/skills/maestro/references/native-ingest-map.md +0 -0
  124. package/skills/sage/SKILL.md +2 -0
  125. package/skills/sage/agents/openai.yaml +0 -0
  126. package/skills/sage/references/source-selection.md +8 -0
  127. package/skills/tdd/SKILL.md +0 -0
  128. package/skills/tdd/agents/openai.yaml +0 -0
  129. package/skills/vet/SKILL.md +2 -0
  130. package/skills/vet/agents/openai.yaml +0 -0
  131. package/skills/vet/references/security-playbooks.md +7 -0
  132. package/skills/vibe/SKILL.md +2 -0
  133. package/skills/vibe/agents/openai.yaml +0 -0
  134. package/src/bootstrap.js +17 -0
  135. package/src/build-gate.js +2 -2
  136. package/src/launcher.js +4 -0
  137. package/src/mcp-live-client.js +289 -3
  138. package/src/paths.js +4 -0
  139. package/src/policy.js +1 -1
  140. package/src/release-issue-gates.js +190 -0
  141. package/src/runtime/active-autonomy-core.js +208 -0
  142. package/src/runtime/alignment-sentinel.js +165 -0
  143. package/src/runtime/architect-review.js +88 -0
  144. package/src/runtime/build-readiness.js +28 -4
  145. package/src/runtime/code-graph-rehearse.js +113 -0
  146. package/src/runtime/context-economy-core.js +276 -0
  147. package/src/runtime/continuity-notes.js +0 -0
  148. package/src/runtime/core-source-ingest.js +379 -0
  149. package/src/runtime/detached-provider.js +74 -0
  150. package/src/runtime/environment-awareness-core.js +460 -0
  151. package/src/runtime/exposure-catalog.js +276 -0
  152. package/src/runtime/guidance-stack.js +0 -0
  153. package/src/runtime/helper-orchestration-core.js +307 -0
  154. package/src/runtime/learning-loop-core.js +238 -0
  155. package/src/runtime/maestro-events.js +18 -0
  156. package/src/runtime/maestro-manager.js +19 -0
  157. package/src/runtime/maestro-state.js +125 -0
  158. package/src/runtime/mcp-policy.js +192 -0
  159. package/src/runtime/obsidian-integration-core.js +851 -0
  160. package/src/runtime/obsidian-plugin-bridge.js +739 -0
  161. package/src/runtime/orchestrator.js +0 -0
  162. package/src/runtime/prompt-strategy-core.js +230 -0
  163. package/src/runtime/quorum-review.js +90 -0
  164. package/src/runtime/ralph-execution-core.js +217 -0
  165. package/src/runtime/redaction-gateway.js +174 -0
  166. package/src/runtime/runtime-state.js +843 -2
  167. package/src/runtime/semantic-recording-core.js +147 -0
  168. package/src/runtime/signal-hooks.js +15 -0
  169. package/src/runtime/skills-registry-export.js +670 -0
  170. package/src/runtime/startup-path.js +0 -0
  171. package/src/runtime/universal-plugin-broker-core.js +575 -0
  172. package/src/runtime/workspace-intelligence-runtime.js +674 -0
  173. package/src/runtime/workspace-virtualizer.js +102 -0
  174. package/src/runtime/workspaces.js +0 -0
  175. package/src/runtime-artifacts.js +225 -62
  176. package/src/skill-installer.js +0 -0
  177. package/src/skills.js +876 -84
@@ -0,0 +1,174 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readJson, writeFileIfMissing, writeJson } from "../fs-utils.js";
3
+ import { getRuntimeStatePath } from "../paths.js";
4
+ import { appendMaestroEvent } from "./maestro-events.js";
5
+
6
+ const redactionRules = [
7
+ {
8
+ placeholderBase: "__MA_SECURE_CONN_DB__",
9
+ regex: /postgres:\/\/[^\s"'`]+/gi,
10
+ },
11
+ {
12
+ placeholderBase: "__MA_SECURE_CRYPTO_KEY__",
13
+ regex: /-----BEGIN PRIVATE KEY-----[\s\S]+?-----END PRIVATE KEY-----/g,
14
+ },
15
+ {
16
+ placeholderBase: "__MA_ANONYMOUS_IDENTITY__",
17
+ regex: /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,
18
+ },
19
+ {
20
+ placeholderBase: "__MA_SECURE_TOKEN__",
21
+ regex:
22
+ /\b(?:sk-[A-Za-z0-9_-]{16,}|gh[pousr]_[A-Za-z0-9_]{16,}|xox[baprs]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z-_]{20,})\b/g,
23
+ },
24
+ ];
25
+
26
+ export function getRedactionVaultPath() {
27
+ return getRuntimeStatePath("redaction-vault.json");
28
+ }
29
+
30
+ function createDefaultVault() {
31
+ return {
32
+ schemaVersion: "0.1.0",
33
+ entries: {},
34
+ };
35
+ }
36
+
37
+ export async function loadRedactionVaultOrDefault() {
38
+ try {
39
+ return await readJson(getRedactionVaultPath());
40
+ } catch (error) {
41
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
42
+ return createDefaultVault();
43
+ }
44
+
45
+ throw error;
46
+ }
47
+ }
48
+
49
+ export async function seedRedactionVault() {
50
+ await writeFileIfMissing(
51
+ getRedactionVaultPath(),
52
+ `${JSON.stringify(createDefaultVault(), null, 2)}\n`,
53
+ );
54
+ }
55
+
56
+ export async function saveRedactionVault(vault) {
57
+ await writeJson(getRedactionVaultPath(), vault);
58
+ return vault;
59
+ }
60
+
61
+ async function appendRedactionEvent({ replacementCount, metadata }) {
62
+ await appendMaestroEvent({
63
+ record_type: "privacy:redaction_applied",
64
+ gate: metadata.gate ?? "$maestro",
65
+ target: metadata.kind ?? "provider-bound-context",
66
+ replacement_count: replacementCount,
67
+ });
68
+ }
69
+
70
+ export function maskSensitiveText(rawText) {
71
+ let sanitizedText = rawText;
72
+ const replacements = [];
73
+ const seen = new Set();
74
+
75
+ for (const rule of redactionRules) {
76
+ sanitizedText = sanitizedText.replace(rule.regex, (match) => {
77
+ const digest = createHash("sha256").update(`${rule.placeholderBase}:${match}`).digest("hex");
78
+ const placeholder = `${rule.placeholderBase}_${digest.slice(0, 12)}__`;
79
+ if (!seen.has(placeholder)) {
80
+ replacements.push({
81
+ placeholder,
82
+ rawValue: match,
83
+ placeholderBase: rule.placeholderBase,
84
+ });
85
+ seen.add(placeholder);
86
+ }
87
+ return placeholder;
88
+ });
89
+ }
90
+
91
+ return {
92
+ sanitizedText,
93
+ replacements,
94
+ };
95
+ }
96
+
97
+ export async function redactProviderBoundText(rawText, metadata = {}) {
98
+ const vault = await loadRedactionVaultOrDefault();
99
+ const { sanitizedText, replacements } = maskSensitiveText(rawText);
100
+
101
+ if (replacements.length === 0) {
102
+ return {
103
+ sanitizedText,
104
+ replacements,
105
+ };
106
+ }
107
+
108
+ for (const replacement of replacements) {
109
+ vault.entries[replacement.placeholder] = {
110
+ rawValue: replacement.rawValue,
111
+ placeholderBase: replacement.placeholderBase,
112
+ createdAt: new Date().toISOString(),
113
+ metadata,
114
+ };
115
+ }
116
+
117
+ await saveRedactionVault(vault);
118
+ await appendRedactionEvent({ replacementCount: replacements.length, metadata });
119
+ return {
120
+ sanitizedText,
121
+ replacements,
122
+ };
123
+ }
124
+
125
+ function redactPayloadValue(value, replacements) {
126
+ if (typeof value === "string") {
127
+ const result = maskSensitiveText(value);
128
+ replacements.push(...result.replacements);
129
+ return result.sanitizedText;
130
+ }
131
+
132
+ if (Array.isArray(value)) {
133
+ return value.map((item) => redactPayloadValue(item, replacements));
134
+ }
135
+
136
+ if (value && typeof value === "object") {
137
+ return Object.fromEntries(
138
+ Object.entries(value).map(([key, entry]) => [key, redactPayloadValue(entry, replacements)]),
139
+ );
140
+ }
141
+
142
+ return value;
143
+ }
144
+
145
+ export async function redactProviderBoundPayload(payload, metadata = {}) {
146
+ const vault = await loadRedactionVaultOrDefault();
147
+ const replacements = [];
148
+ const sanitizedPayload = redactPayloadValue(payload, replacements);
149
+
150
+ for (const replacement of replacements) {
151
+ vault.entries[replacement.placeholder] = {
152
+ rawValue: replacement.rawValue,
153
+ placeholderBase: replacement.placeholderBase,
154
+ createdAt: new Date().toISOString(),
155
+ metadata,
156
+ };
157
+ }
158
+
159
+ if (replacements.length > 0) {
160
+ await saveRedactionVault(vault);
161
+ await appendRedactionEvent({ replacementCount: replacements.length, metadata });
162
+ }
163
+
164
+ return {
165
+ sanitizedPayload,
166
+ replacements,
167
+ redaction_receipt: {
168
+ record_type: "redaction_receipt",
169
+ replacement_count: replacements.length,
170
+ provider_safe: true,
171
+ raw_values_stored_locally: replacements.length > 0,
172
+ },
173
+ };
174
+ }