@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.
- package/.agents/plugins/marketplace.json +0 -0
- package/.codex/agents/Architect.toml +0 -2
- package/.codex/agents/Auditor.toml +0 -2
- package/.codex/agents/Builder.toml +0 -2
- package/.codex/agents/Flow.toml +0 -2
- package/.codex/agents/Sage.toml +0 -2
- package/.codex/agents/Vibe.toml +0 -2
- package/.codex/hooks.json +14 -13
- package/.codex/prompts/enforcement.md +4 -0
- package/.codex/prompts/skill-contract.md +4 -0
- package/COVERAGE.md +211 -0
- package/DEMO.md +265 -0
- package/README.md +159 -16
- package/bin/ma.js +219 -14
- package/data/clone-data.ledger.json +41 -0
- package/data/clone-data.proof.json +50 -0
- package/data/clone-data.rvf +37 -0
- package/docs/README.md +4 -1
- package/docs/assets/image/Screenshot(1).png +0 -0
- package/docs/assets/image/Screenshot(2).png +0 -0
- package/docs/assets/image/Screenshot(3).png +0 -0
- package/docs/assets/image/Screenshot(4).png +0 -0
- package/docs/assets/image/Screenshot(5).png +0 -0
- package/docs/assets/image/Screenshot(6).png +0 -0
- package/docs/assets/image/Screenshot(7).png +0 -0
- package/docs/assets/image/Screenshot(8).png +0 -0
- package/docs/assets/image/Screenshot(9).png +0 -0
- package/docs/assets/meta-architect-logo.png +0 -0
- package/docs/assets/meta-architect-logo.svg +0 -0
- package/docs/getting-started.md +38 -22
- package/docs/installed-sdk.md +0 -0
- package/docs/mcp-setup.md +35 -0
- package/docs/onboarding.md +18 -2
- package/docs/prompt-guidance-contract.md +17 -0
- package/docs/prompt-guidance-fragments/active-autonomy-core.md +7 -0
- package/docs/qa/release-issue-gates-0.1.13.json +644 -0
- package/docs/qa/{release-readiness-0.1.12.md → release-readiness-0.1.13.md} +25 -9
- package/docs/qa/release-readiness-0.1.5.md +1 -1
- package/docs/reference/native-engineering-patterns.md +0 -0
- package/docs/reference/native-security-playbooks.md +6 -0
- package/docs/reference/native-source-selection.md +6 -0
- package/docs/reference/native-style-and-deslop.md +0 -0
- package/docs/release-spec.md +25 -9
- package/docs/skills.md +14 -1
- package/index.js +222 -2
- package/mcp/collections.json +23 -6
- package/mcp/local/code-intel.js +0 -0
- package/mcp/local/memory.js +0 -0
- package/mcp/local/playbooks.js +0 -0
- package/mcp/local/state.js +0 -0
- package/mcp/local/team-run.js +48 -1
- package/mcp/local/trace.js +0 -0
- package/mcp/local-capabilities.json +0 -0
- package/mcp/native-playbooks.json +0 -0
- package/mcp/servers.json +24 -0
- package/package.json +5 -2
- package/plugins/meta-architect/.app.json +1 -1
- package/plugins/meta-architect/.codex-plugin/plugin.json +1 -1
- package/plugins/meta-architect/.mcp.json +1 -1
- package/plugins/meta-architect/README.md +8 -1
- package/plugins/meta-architect/obsidian/main.js +401 -0
- package/plugins/meta-architect/obsidian/manifest.json +9 -0
- package/plugins/meta-architect/obsidian/styles.css +7 -0
- package/plugins/meta-architect/skills/align/SKILL.md +0 -0
- package/plugins/meta-architect/skills/align/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/align/references/shared-language.md +0 -0
- package/plugins/meta-architect/skills/arch/SKILL.md +2 -0
- package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/build/SKILL.md +3 -0
- package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/cleanup/SKILL.md +0 -0
- package/plugins/meta-architect/skills/cleanup/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/cleanup/references/style-and-deslop.md +0 -0
- package/plugins/meta-architect/skills/diagnose/SKILL.md +0 -0
- package/plugins/meta-architect/skills/diagnose/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/flow/SKILL.md +2 -0
- package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/SKILL.md +0 -0
- package/plugins/meta-architect/skills/maestro/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/maestro/references/core-release-rules.md +0 -0
- package/plugins/meta-architect/skills/maestro/references/native-ingest-map.md +0 -0
- package/plugins/meta-architect/skills/sage/SKILL.md +2 -0
- package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/sage/references/source-selection.md +8 -0
- package/plugins/meta-architect/skills/tdd/SKILL.md +0 -0
- package/plugins/meta-architect/skills/tdd/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/vet/SKILL.md +2 -0
- package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -0
- package/plugins/meta-architect/skills/vet/references/security-playbooks.md +7 -0
- package/plugins/meta-architect/skills/vibe/SKILL.md +2 -0
- package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -0
- package/scripts/active-autonomy-hook.mjs +96 -0
- package/scripts/biome-staged.js +0 -0
- package/scripts/build-linux-packages.mjs +0 -0
- package/scripts/doctor.js +17 -4
- package/scripts/install.sh +28 -0
- package/scripts/linux-package-lib.mjs +0 -0
- package/scripts/linux-package-smoke.mjs +0 -0
- package/scripts/plugin-sync.js +0 -0
- package/scripts/postinstall.js +0 -0
- package/scripts/ralph/prompt.md +35 -0
- package/scripts/release-metadata.js +0 -0
- package/scripts/release-sync.js +0 -0
- package/scripts/release-verify.js +166 -1
- package/scripts/setup-npmrc.js +0 -0
- package/skills/align/SKILL.md +0 -0
- package/skills/align/agents/openai.yaml +0 -0
- package/skills/align/references/shared-language.md +0 -0
- package/skills/arch/SKILL.md +2 -0
- package/skills/arch/agents/openai.yaml +0 -0
- package/skills/build/SKILL.md +3 -0
- package/skills/build/agents/openai.yaml +0 -0
- package/skills/cleanup/SKILL.md +0 -0
- package/skills/cleanup/agents/openai.yaml +0 -0
- package/skills/cleanup/references/style-and-deslop.md +0 -0
- package/skills/diagnose/SKILL.md +0 -0
- package/skills/diagnose/agents/openai.yaml +0 -0
- package/skills/flow/SKILL.md +2 -0
- package/skills/flow/agents/openai.yaml +0 -0
- package/skills/maestro/SKILL.md +0 -0
- package/skills/maestro/agents/openai.yaml +0 -0
- package/skills/maestro/references/core-release-rules.md +0 -0
- package/skills/maestro/references/native-ingest-map.md +0 -0
- package/skills/sage/SKILL.md +2 -0
- package/skills/sage/agents/openai.yaml +0 -0
- package/skills/sage/references/source-selection.md +8 -0
- package/skills/tdd/SKILL.md +0 -0
- package/skills/tdd/agents/openai.yaml +0 -0
- package/skills/vet/SKILL.md +2 -0
- package/skills/vet/agents/openai.yaml +0 -0
- package/skills/vet/references/security-playbooks.md +7 -0
- package/skills/vibe/SKILL.md +2 -0
- package/skills/vibe/agents/openai.yaml +0 -0
- package/src/bootstrap.js +17 -0
- package/src/build-gate.js +2 -2
- package/src/launcher.js +4 -0
- package/src/mcp-live-client.js +289 -3
- package/src/paths.js +4 -0
- package/src/policy.js +1 -1
- package/src/release-issue-gates.js +190 -0
- package/src/runtime/active-autonomy-core.js +208 -0
- package/src/runtime/alignment-sentinel.js +165 -0
- package/src/runtime/architect-review.js +88 -0
- package/src/runtime/build-readiness.js +28 -4
- package/src/runtime/code-graph-rehearse.js +113 -0
- package/src/runtime/context-economy-core.js +276 -0
- package/src/runtime/continuity-notes.js +0 -0
- package/src/runtime/core-source-ingest.js +379 -0
- package/src/runtime/detached-provider.js +74 -0
- package/src/runtime/environment-awareness-core.js +460 -0
- package/src/runtime/exposure-catalog.js +276 -0
- package/src/runtime/guidance-stack.js +0 -0
- package/src/runtime/helper-orchestration-core.js +307 -0
- package/src/runtime/learning-loop-core.js +238 -0
- package/src/runtime/maestro-events.js +18 -0
- package/src/runtime/maestro-manager.js +19 -0
- package/src/runtime/maestro-state.js +125 -0
- package/src/runtime/mcp-policy.js +192 -0
- package/src/runtime/obsidian-integration-core.js +851 -0
- package/src/runtime/obsidian-plugin-bridge.js +739 -0
- package/src/runtime/orchestrator.js +0 -0
- package/src/runtime/prompt-strategy-core.js +230 -0
- package/src/runtime/quorum-review.js +90 -0
- package/src/runtime/ralph-execution-core.js +217 -0
- package/src/runtime/redaction-gateway.js +174 -0
- package/src/runtime/runtime-state.js +843 -2
- package/src/runtime/semantic-recording-core.js +147 -0
- package/src/runtime/signal-hooks.js +15 -0
- package/src/runtime/skills-registry-export.js +670 -0
- package/src/runtime/startup-path.js +0 -0
- package/src/runtime/universal-plugin-broker-core.js +575 -0
- package/src/runtime/workspace-intelligence-runtime.js +674 -0
- package/src/runtime/workspace-virtualizer.js +102 -0
- package/src/runtime/workspaces.js +0 -0
- package/src/runtime-artifacts.js +225 -62
- package/src/skill-installer.js +0 -0
- 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
|
+
}
|