@uniqbit/mate-core 0.15.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -0
- package/src/env.test.ts +92 -0
- package/src/env.ts +69 -0
- package/src/guidance.test.ts +117 -0
- package/src/guidance.ts +103 -0
- package/src/index.ts +16 -0
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uniqbit/mate-core",
|
|
3
|
+
"version": "0.15.0-canary.0",
|
|
4
|
+
"description": "Shared Mate companion runtime protocol: launch environment and guidance-file contract.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"src/"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.ts"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public",
|
|
15
|
+
"registry": "https://registry.npmjs.org/"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "CI=1 bun test",
|
|
19
|
+
"lint": "oxlint src/",
|
|
20
|
+
"lint:fix": "oxlint src/ --fix",
|
|
21
|
+
"format": "oxfmt src/",
|
|
22
|
+
"format:check": "oxfmt src/ --check"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/bun": "^1.3.14"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": "24.x"
|
|
29
|
+
},
|
|
30
|
+
"packageManager": "bun@1.3.14"
|
|
31
|
+
}
|
package/src/env.test.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import { MATE_ENV, isManagedCompanionContext, readCompanionRuntimeContext } from "./env";
|
|
4
|
+
|
|
5
|
+
describe("MATE_ENV", () => {
|
|
6
|
+
test("exposes the stable launch environment variable names", () => {
|
|
7
|
+
expect(MATE_ENV.frameworkName).toBe("MATE_NAME");
|
|
8
|
+
expect(MATE_ENV.version).toBe("MATE_VERSION");
|
|
9
|
+
expect(MATE_ENV.companionPath).toBe("MATE_ARTIFACT_PATH");
|
|
10
|
+
expect(MATE_ENV.wrapperBinPath).toBe("MATE_WRAPPER_BIN_PATH");
|
|
11
|
+
expect(MATE_ENV.repositoryPath).toBe("MATE_REPO_PATH");
|
|
12
|
+
expect(MATE_ENV.repositoryId).toBe("MATE_REPO_ID");
|
|
13
|
+
expect(MATE_ENV.repositoryProfile).toBe("MATE_REPO_PROFILE");
|
|
14
|
+
expect(MATE_ENV.policyJson).toBe("MATE_POLICY_JSON");
|
|
15
|
+
expect(MATE_ENV.graphifyEnabled).toBe("MATE_GRAPHIFY_ENABLED");
|
|
16
|
+
expect(MATE_ENV.gitAutoMode).toBe("MATE_GIT_AUTO_MODE");
|
|
17
|
+
expect(MATE_ENV.reactDoctorEnabled).toBe("MATE_REACT_DOCTOR_ENABLED");
|
|
18
|
+
expect(MATE_ENV.reactDoctorBinPath).toBe("MATE_REACT_DOCTOR_BIN_PATH");
|
|
19
|
+
expect(MATE_ENV.guidanceJson).toBe("MATE_GUIDANCE_JSON");
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe("readCompanionRuntimeContext", () => {
|
|
24
|
+
test("normalizes a fully managed environment", () => {
|
|
25
|
+
const context = readCompanionRuntimeContext({
|
|
26
|
+
MATE_NAME: "acme-mate",
|
|
27
|
+
MATE_ARTIFACT_PATH: "/companions/acme",
|
|
28
|
+
MATE_REPO_PATH: "/repos/acme",
|
|
29
|
+
MATE_REPO_ID: "acme",
|
|
30
|
+
MATE_REPO_PROFILE: "default",
|
|
31
|
+
MATE_POLICY_JSON: '{"allowedAgents":["opencode"]}',
|
|
32
|
+
MATE_GRAPHIFY_ENABLED: "1",
|
|
33
|
+
MATE_GIT_AUTO_MODE: "0",
|
|
34
|
+
MATE_REACT_DOCTOR_ENABLED: "1",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
expect(context).toEqual({
|
|
38
|
+
frameworkName: "acme-mate",
|
|
39
|
+
companionPath: "/companions/acme",
|
|
40
|
+
repositoryPath: "/repos/acme",
|
|
41
|
+
repositoryId: "acme",
|
|
42
|
+
repositoryProfile: "default",
|
|
43
|
+
policyJson: '{"allowedAgents":["opencode"]}',
|
|
44
|
+
graphifyEnabled: true,
|
|
45
|
+
gitAutoModeEnabled: false,
|
|
46
|
+
reactDoctorEnabled: true,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("falls back to inert defaults when the environment is unmanaged", () => {
|
|
51
|
+
const context = readCompanionRuntimeContext({});
|
|
52
|
+
|
|
53
|
+
expect(context.frameworkName).toBe("mate");
|
|
54
|
+
expect(context.companionPath).toBe("");
|
|
55
|
+
expect(context.repositoryPath).toBe("");
|
|
56
|
+
expect(context.policyJson).toBe("{}");
|
|
57
|
+
expect(context.graphifyEnabled).toBe(false);
|
|
58
|
+
expect(context.gitAutoModeEnabled).toBe(false);
|
|
59
|
+
expect(context.reactDoctorEnabled).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("treats non-'1' flag values as disabled", () => {
|
|
63
|
+
const context = readCompanionRuntimeContext({
|
|
64
|
+
MATE_GRAPHIFY_ENABLED: "true",
|
|
65
|
+
MATE_GIT_AUTO_MODE: "yes",
|
|
66
|
+
MATE_REACT_DOCTOR_ENABLED: "0",
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
expect(context.graphifyEnabled).toBe(false);
|
|
70
|
+
expect(context.gitAutoModeEnabled).toBe(false);
|
|
71
|
+
expect(context.reactDoctorEnabled).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("isManagedCompanionContext", () => {
|
|
76
|
+
test("requires both companion and repository paths", () => {
|
|
77
|
+
const managed = readCompanionRuntimeContext({
|
|
78
|
+
MATE_ARTIFACT_PATH: "/companions/acme",
|
|
79
|
+
MATE_REPO_PATH: "/repos/acme",
|
|
80
|
+
});
|
|
81
|
+
const missingRepo = readCompanionRuntimeContext({
|
|
82
|
+
MATE_ARTIFACT_PATH: "/companions/acme",
|
|
83
|
+
});
|
|
84
|
+
const missingCompanion = readCompanionRuntimeContext({
|
|
85
|
+
MATE_REPO_PATH: "/repos/acme",
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
expect(isManagedCompanionContext(managed)).toBe(true);
|
|
89
|
+
expect(isManagedCompanionContext(missingRepo)).toBe(false);
|
|
90
|
+
expect(isManagedCompanionContext(missingCompanion)).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
});
|
package/src/env.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable Mate launch environment contract shared by the CLI (writer) and the
|
|
3
|
+
* OpenCode runtime plugins (readers). The CLI materializes these variables for
|
|
4
|
+
* every managed session; plugins must consume them through this module instead
|
|
5
|
+
* of hard-coding variable names.
|
|
6
|
+
*/
|
|
7
|
+
export const MATE_ENV = {
|
|
8
|
+
frameworkName: "MATE_NAME",
|
|
9
|
+
version: "MATE_VERSION",
|
|
10
|
+
companionPath: "MATE_ARTIFACT_PATH",
|
|
11
|
+
wrapperBinPath: "MATE_WRAPPER_BIN_PATH",
|
|
12
|
+
repositoryPath: "MATE_REPO_PATH",
|
|
13
|
+
repositoryId: "MATE_REPO_ID",
|
|
14
|
+
repositoryProfile: "MATE_REPO_PROFILE",
|
|
15
|
+
policyJson: "MATE_POLICY_JSON",
|
|
16
|
+
graphifyEnabled: "MATE_GRAPHIFY_ENABLED",
|
|
17
|
+
gitAutoMode: "MATE_GIT_AUTO_MODE",
|
|
18
|
+
reactDoctorEnabled: "MATE_REACT_DOCTOR_ENABLED",
|
|
19
|
+
reactDoctorBinPath: "MATE_REACT_DOCTOR_BIN_PATH",
|
|
20
|
+
/**
|
|
21
|
+
* Serialized `MateGuidanceFile` JSON built by the CLI per managed launch.
|
|
22
|
+
* Session-scoped: the plugin consumes it at startup and masks it from
|
|
23
|
+
* spawned shells so it never leaks into subprocess environments.
|
|
24
|
+
*/
|
|
25
|
+
guidanceJson: "MATE_GUIDANCE_JSON",
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
export type MateEnvVariable = (typeof MATE_ENV)[keyof typeof MATE_ENV];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Normalized companion runtime context derived from the Mate launch
|
|
32
|
+
* environment. Contains no repository-specific defaults; every value comes
|
|
33
|
+
* from the active session environment.
|
|
34
|
+
*/
|
|
35
|
+
export type CompanionRuntimeContext = {
|
|
36
|
+
frameworkName: string;
|
|
37
|
+
companionPath: string;
|
|
38
|
+
repositoryPath: string;
|
|
39
|
+
repositoryId: string;
|
|
40
|
+
repositoryProfile: string;
|
|
41
|
+
policyJson: string;
|
|
42
|
+
graphifyEnabled: boolean;
|
|
43
|
+
gitAutoModeEnabled: boolean;
|
|
44
|
+
reactDoctorEnabled: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function readCompanionRuntimeContext(
|
|
48
|
+
env: Record<string, string | undefined> = process.env,
|
|
49
|
+
): CompanionRuntimeContext {
|
|
50
|
+
return {
|
|
51
|
+
frameworkName: env[MATE_ENV.frameworkName] ?? "mate",
|
|
52
|
+
companionPath: env[MATE_ENV.companionPath] ?? "",
|
|
53
|
+
repositoryPath: env[MATE_ENV.repositoryPath] ?? "",
|
|
54
|
+
repositoryId: env[MATE_ENV.repositoryId] ?? "",
|
|
55
|
+
repositoryProfile: env[MATE_ENV.repositoryProfile] ?? "",
|
|
56
|
+
policyJson: env[MATE_ENV.policyJson] ?? "{}",
|
|
57
|
+
graphifyEnabled: env[MATE_ENV.graphifyEnabled] === "1",
|
|
58
|
+
gitAutoModeEnabled: env[MATE_ENV.gitAutoMode] === "1",
|
|
59
|
+
reactDoctorEnabled: env[MATE_ENV.reactDoctorEnabled] === "1",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A session is Mate-managed only when the CLI exported both the companion
|
|
65
|
+
* path and the working repository path. Plugins must stay inert otherwise.
|
|
66
|
+
*/
|
|
67
|
+
export function isManagedCompanionContext(context: CompanionRuntimeContext): boolean {
|
|
68
|
+
return Boolean(context.companionPath && context.repositoryPath);
|
|
69
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CODEBASE_EXPLORATION_MARKER,
|
|
5
|
+
COMPANION_POLICY_MARKER,
|
|
6
|
+
GUIDANCE_FILE_VERSION,
|
|
7
|
+
parseGuidanceContent,
|
|
8
|
+
validateGuidanceData,
|
|
9
|
+
} from "./guidance";
|
|
10
|
+
import { MATE_ENV } from "./env";
|
|
11
|
+
|
|
12
|
+
const validGuidance = {
|
|
13
|
+
version: 1,
|
|
14
|
+
companionGuidance: `${COMPANION_POLICY_MARKER}framework="mate">policy</companion-policy>`,
|
|
15
|
+
codebaseExplorationGuidance: `${CODEBASE_EXPLORATION_MARKER}priority="mandatory">rules</codebase-exploration-rules>`,
|
|
16
|
+
errors: [],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe("guidance contract constants", () => {
|
|
20
|
+
test("delivery variable and version are stable", () => {
|
|
21
|
+
expect(MATE_ENV.guidanceJson).toBe("MATE_GUIDANCE_JSON");
|
|
22
|
+
expect(GUIDANCE_FILE_VERSION).toBe(1);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe("validateGuidanceData", () => {
|
|
27
|
+
test("accepts a valid guidance payload", () => {
|
|
28
|
+
const result = validateGuidanceData(validGuidance);
|
|
29
|
+
|
|
30
|
+
expect(result.errors).toEqual([]);
|
|
31
|
+
expect(result.guidance.companionGuidance).toBe(validGuidance.companionGuidance);
|
|
32
|
+
expect(result.guidance.codebaseExplorationGuidance).toBe(
|
|
33
|
+
validGuidance.codebaseExplorationGuidance,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("accepts empty codebase exploration guidance", () => {
|
|
38
|
+
const result = validateGuidanceData({
|
|
39
|
+
...validGuidance,
|
|
40
|
+
codebaseExplorationGuidance: "",
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
expect(result.errors).toEqual([]);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("rejects a non-object payload", () => {
|
|
47
|
+
expect(validateGuidanceData(null).errors).toEqual(["guidance data is not a JSON object"]);
|
|
48
|
+
expect(validateGuidanceData([]).errors).toEqual(["guidance data is not a JSON object"]);
|
|
49
|
+
expect(validateGuidanceData("guidance").errors).toEqual(["guidance data is not a JSON object"]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("rejects an unsupported version", () => {
|
|
53
|
+
const result = validateGuidanceData({ ...validGuidance, version: 2 });
|
|
54
|
+
|
|
55
|
+
expect(result.errors).toContain("unsupported guidance data version");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("rejects missing companion guidance", () => {
|
|
59
|
+
const missing = validateGuidanceData({ ...validGuidance, companionGuidance: undefined });
|
|
60
|
+
const empty = validateGuidanceData({ ...validGuidance, companionGuidance: " " });
|
|
61
|
+
|
|
62
|
+
expect(missing.errors).toContain("missing injected companion guidance");
|
|
63
|
+
expect(empty.errors).toContain("missing injected companion guidance");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("rejects companion guidance without the policy marker", () => {
|
|
67
|
+
const result = validateGuidanceData({
|
|
68
|
+
...validGuidance,
|
|
69
|
+
companionGuidance: "plain guidance without marker",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
expect(result.errors).toContain("injected companion guidance is malformed");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test("rejects missing codebase exploration guidance field", () => {
|
|
76
|
+
const result = validateGuidanceData({
|
|
77
|
+
...validGuidance,
|
|
78
|
+
codebaseExplorationGuidance: undefined,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
expect(result.errors).toContain("missing injected codebase exploration guidance");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test("rejects non-empty codebase exploration guidance without its marker", () => {
|
|
85
|
+
const result = validateGuidanceData({
|
|
86
|
+
...validGuidance,
|
|
87
|
+
codebaseExplorationGuidance: "rules without marker",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
expect(result.errors).toContain("injected codebase exploration guidance is malformed");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test("carries embedded generation errors through", () => {
|
|
94
|
+
const result = validateGuidanceData({
|
|
95
|
+
...validGuidance,
|
|
96
|
+
errors: ["companion guidance was not injected", "", 42],
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
expect(result.errors).toEqual(["companion guidance was not injected"]);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("parseGuidanceContent", () => {
|
|
104
|
+
test("parses and validates valid JSON content", () => {
|
|
105
|
+
const result = parseGuidanceContent(JSON.stringify(validGuidance));
|
|
106
|
+
|
|
107
|
+
expect(result.errors).toEqual([]);
|
|
108
|
+
expect(result.guidance.version).toBe(1);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("reports invalid JSON without throwing", () => {
|
|
112
|
+
const result = parseGuidanceContent("{not json");
|
|
113
|
+
|
|
114
|
+
expect(result.errors).toEqual(["guidance data is not valid JSON"]);
|
|
115
|
+
expect(result.guidance.companionGuidance).toBe("");
|
|
116
|
+
});
|
|
117
|
+
});
|
package/src/guidance.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Versioned companion guidance contract. The CLI builds the guidance data
|
|
3
|
+
* from its playbooks at launch time and delivers it through the
|
|
4
|
+
* `MATE_GUIDANCE_JSON` launch environment variable (see `MATE_ENV`); the
|
|
5
|
+
* OpenCode plugin parses and validates it at session start.
|
|
6
|
+
*/
|
|
7
|
+
export const GUIDANCE_FILE_VERSION = 1;
|
|
8
|
+
|
|
9
|
+
/** Marker every injected companion guidance block must contain. */
|
|
10
|
+
export const COMPANION_POLICY_MARKER = "<companion-policy ";
|
|
11
|
+
/** Marker every non-empty codebase exploration guidance block must contain. */
|
|
12
|
+
export const CODEBASE_EXPLORATION_MARKER = "<codebase-exploration-rules ";
|
|
13
|
+
|
|
14
|
+
export type MateGuidanceFile = {
|
|
15
|
+
version: number;
|
|
16
|
+
companionGuidance: string;
|
|
17
|
+
codebaseExplorationGuidance: string;
|
|
18
|
+
errors: string[];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type GuidanceValidation = {
|
|
22
|
+
guidance: MateGuidanceFile;
|
|
23
|
+
errors: string[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
27
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function emptyGuidance(errors: string[]): GuidanceValidation {
|
|
31
|
+
return {
|
|
32
|
+
guidance: {
|
|
33
|
+
version: GUIDANCE_FILE_VERSION,
|
|
34
|
+
companionGuidance: "",
|
|
35
|
+
codebaseExplorationGuidance: "",
|
|
36
|
+
errors,
|
|
37
|
+
},
|
|
38
|
+
errors,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Validate an already-parsed guidance value against the versioned contract.
|
|
44
|
+
* Returns the normalized guidance data plus every contract violation found.
|
|
45
|
+
*/
|
|
46
|
+
export function validateGuidanceData(value: unknown): GuidanceValidation {
|
|
47
|
+
if (!isRecord(value)) {
|
|
48
|
+
return emptyGuidance(["guidance data is not a JSON object"]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const errors = Array.isArray(value.errors)
|
|
52
|
+
? value.errors.filter((entry): entry is string => typeof entry === "string" && Boolean(entry))
|
|
53
|
+
: [];
|
|
54
|
+
|
|
55
|
+
if (value.version !== GUIDANCE_FILE_VERSION) {
|
|
56
|
+
errors.push("unsupported guidance data version");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const companionGuidance =
|
|
60
|
+
typeof value.companionGuidance === "string" ? value.companionGuidance : "";
|
|
61
|
+
if (!companionGuidance.trim()) {
|
|
62
|
+
errors.push("missing injected companion guidance");
|
|
63
|
+
} else if (!companionGuidance.includes(COMPANION_POLICY_MARKER)) {
|
|
64
|
+
errors.push("injected companion guidance is malformed");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (typeof value.codebaseExplorationGuidance !== "string") {
|
|
68
|
+
errors.push("missing injected codebase exploration guidance");
|
|
69
|
+
}
|
|
70
|
+
const codebaseExplorationGuidance =
|
|
71
|
+
typeof value.codebaseExplorationGuidance === "string" ? value.codebaseExplorationGuidance : "";
|
|
72
|
+
if (
|
|
73
|
+
codebaseExplorationGuidance.trim() &&
|
|
74
|
+
!codebaseExplorationGuidance.includes(CODEBASE_EXPLORATION_MARKER)
|
|
75
|
+
) {
|
|
76
|
+
errors.push("injected codebase exploration guidance is malformed");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
guidance: {
|
|
81
|
+
version: GUIDANCE_FILE_VERSION,
|
|
82
|
+
companionGuidance,
|
|
83
|
+
codebaseExplorationGuidance,
|
|
84
|
+
errors,
|
|
85
|
+
},
|
|
86
|
+
errors,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Parse raw guidance JSON (the `MATE_GUIDANCE_JSON` value) and validate it
|
|
92
|
+
* against the contract.
|
|
93
|
+
*/
|
|
94
|
+
export function parseGuidanceContent(content: string): GuidanceValidation {
|
|
95
|
+
let parsed: unknown;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(content);
|
|
98
|
+
} catch {
|
|
99
|
+
return emptyGuidance(["guidance data is not valid JSON"]);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return validateGuidanceData(parsed);
|
|
103
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export {
|
|
2
|
+
MATE_ENV,
|
|
3
|
+
isManagedCompanionContext,
|
|
4
|
+
readCompanionRuntimeContext,
|
|
5
|
+
type CompanionRuntimeContext,
|
|
6
|
+
type MateEnvVariable,
|
|
7
|
+
} from "./env";
|
|
8
|
+
export {
|
|
9
|
+
CODEBASE_EXPLORATION_MARKER,
|
|
10
|
+
COMPANION_POLICY_MARKER,
|
|
11
|
+
GUIDANCE_FILE_VERSION,
|
|
12
|
+
parseGuidanceContent,
|
|
13
|
+
validateGuidanceData,
|
|
14
|
+
type GuidanceValidation,
|
|
15
|
+
type MateGuidanceFile,
|
|
16
|
+
} from "./guidance";
|