@alan512/experienceengine 0.1.2 → 0.1.3

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 (215) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.mcp.json +4 -8
  3. package/LICENSE +21 -0
  4. package/README.md +158 -47
  5. package/README.zh-CN.md +178 -57
  6. package/dist/adapters/codex/instruction-template.d.ts +3 -0
  7. package/dist/adapters/codex/instruction-template.js +12 -0
  8. package/dist/adapters/codex/instruction-template.js.map +1 -0
  9. package/dist/adapters/codex/mcp-server.d.ts +38 -41
  10. package/dist/adapters/codex/mcp-server.js +107 -338
  11. package/dist/adapters/codex/mcp-server.js.map +1 -1
  12. package/dist/analyzer/llm-learning-gate.js +39 -0
  13. package/dist/analyzer/llm-learning-gate.js.map +1 -1
  14. package/dist/cli/commands/claude-hook.js +12 -3
  15. package/dist/cli/commands/claude-hook.js.map +1 -1
  16. package/dist/cli/commands/config.js +88 -2
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/doctor.d.ts +4 -28
  19. package/dist/cli/commands/doctor.js +136 -68
  20. package/dist/cli/commands/doctor.js.map +1 -1
  21. package/dist/cli/commands/feedback.js +4 -0
  22. package/dist/cli/commands/feedback.js.map +1 -1
  23. package/dist/cli/commands/init.d.ts +28 -0
  24. package/dist/cli/commands/init.js +419 -0
  25. package/dist/cli/commands/init.js.map +1 -0
  26. package/dist/cli/commands/inspect.js +203 -37
  27. package/dist/cli/commands/inspect.js.map +1 -1
  28. package/dist/cli/commands/install.js +9 -0
  29. package/dist/cli/commands/install.js.map +1 -1
  30. package/dist/cli/commands/maintenance.js +1 -1
  31. package/dist/cli/commands/maintenance.js.map +1 -1
  32. package/dist/cli/commands/mcp-server.js +4 -0
  33. package/dist/cli/commands/mcp-server.js.map +1 -1
  34. package/dist/cli/commands/status.js +57 -7
  35. package/dist/cli/commands/status.js.map +1 -1
  36. package/dist/cli/dispatch.js +22 -7
  37. package/dist/cli/dispatch.js.map +1 -1
  38. package/dist/cli/state-model.d.ts +14 -0
  39. package/dist/cli/state-model.js +23 -0
  40. package/dist/cli/state-model.js.map +1 -0
  41. package/dist/config/config-schema.d.ts +32 -0
  42. package/dist/config/config-schema.js +26 -0
  43. package/dist/config/config-schema.js.map +1 -1
  44. package/dist/config/default-config.js +3 -0
  45. package/dist/config/default-config.js.map +1 -1
  46. package/dist/config/load-config.js +19 -1
  47. package/dist/config/load-config.js.map +1 -1
  48. package/dist/config/path-resolver.d.ts +0 -1
  49. package/dist/config/path-resolver.js +0 -2
  50. package/dist/config/path-resolver.js.map +1 -1
  51. package/dist/config/runtime-env.d.ts +8 -0
  52. package/dist/config/runtime-env.js +14 -0
  53. package/dist/config/runtime-env.js.map +1 -0
  54. package/dist/config/secrets-store.d.ts +15 -0
  55. package/dist/config/secrets-store.js +56 -0
  56. package/dist/config/secrets-store.js.map +1 -0
  57. package/dist/config/settings-store.d.ts +10 -0
  58. package/dist/config/settings-store.js +44 -0
  59. package/dist/config/settings-store.js.map +1 -1
  60. package/dist/controller/candidate-retriever.d.ts +35 -2
  61. package/dist/controller/candidate-retriever.js +189 -10
  62. package/dist/controller/candidate-retriever.js.map +1 -1
  63. package/dist/controller/injection-renderer.js +52 -1
  64. package/dist/controller/injection-renderer.js.map +1 -1
  65. package/dist/controller/injection-scorecard.d.ts +14 -2
  66. package/dist/controller/injection-scorecard.js +18 -1
  67. package/dist/controller/injection-scorecard.js.map +1 -1
  68. package/dist/controller/intervention-controller.d.ts +15 -2
  69. package/dist/controller/intervention-controller.js +173 -11
  70. package/dist/controller/intervention-controller.js.map +1 -1
  71. package/dist/controller/lexical-retriever.d.ts +14 -0
  72. package/dist/controller/lexical-retriever.js +117 -0
  73. package/dist/controller/lexical-retriever.js.map +1 -0
  74. package/dist/controller/model-reranker.d.ts +20 -0
  75. package/dist/controller/model-reranker.js +187 -0
  76. package/dist/controller/model-reranker.js.map +1 -0
  77. package/dist/controller/node-ranker.js +1 -0
  78. package/dist/controller/node-ranker.js.map +1 -1
  79. package/dist/controller/query-rewrite.d.ts +8 -0
  80. package/dist/controller/query-rewrite.js +69 -0
  81. package/dist/controller/query-rewrite.js.map +1 -0
  82. package/dist/controller/trigger-evaluator.d.ts +23 -2
  83. package/dist/controller/trigger-evaluator.js +57 -3
  84. package/dist/controller/trigger-evaluator.js.map +1 -1
  85. package/dist/distillation/experience-family.d.ts +4 -0
  86. package/dist/distillation/experience-family.js +14 -0
  87. package/dist/distillation/experience-family.js.map +1 -0
  88. package/dist/distillation/host-llm.d.ts +1 -0
  89. package/dist/distillation/host-llm.js +5 -1
  90. package/dist/distillation/host-llm.js.map +1 -1
  91. package/dist/distillation/llm-distiller.js +4 -0
  92. package/dist/distillation/llm-distiller.js.map +1 -1
  93. package/dist/distillation/merge-decider.js +4 -0
  94. package/dist/distillation/merge-decider.js.map +1 -1
  95. package/dist/distillation/prompt-contract.d.ts +1 -1
  96. package/dist/distillation/prompt-contract.js +3 -0
  97. package/dist/distillation/prompt-contract.js.map +1 -1
  98. package/dist/distillation/queue-worker.js +57 -7
  99. package/dist/distillation/queue-worker.js.map +1 -1
  100. package/dist/feedback/state-transition.js +9 -0
  101. package/dist/feedback/state-transition.js.map +1 -1
  102. package/dist/input/input-adapter.js +2 -1
  103. package/dist/input/input-adapter.js.map +1 -1
  104. package/dist/input/outcome-resolver.js +5 -5
  105. package/dist/input/outcome-resolver.js.map +1 -1
  106. package/dist/input/tasktype-resolver.js +2 -0
  107. package/dist/input/tasktype-resolver.js.map +1 -1
  108. package/dist/input/tool-event-significance.d.ts +5 -0
  109. package/dist/input/tool-event-significance.js +7 -0
  110. package/dist/input/tool-event-significance.js.map +1 -0
  111. package/dist/install/claude-code-doctor.d.ts +7 -2
  112. package/dist/install/claude-code-doctor.js +38 -9
  113. package/dist/install/claude-code-doctor.js.map +1 -1
  114. package/dist/install/claude-marketplace-state.d.ts +14 -0
  115. package/dist/install/claude-marketplace-state.js +47 -0
  116. package/dist/install/claude-marketplace-state.js.map +1 -0
  117. package/dist/install/codex-installer.d.ts +18 -0
  118. package/dist/install/codex-installer.js +91 -1
  119. package/dist/install/codex-installer.js.map +1 -1
  120. package/dist/install/openclaw-installer.d.ts +7 -0
  121. package/dist/install/openclaw-installer.js +16 -0
  122. package/dist/install/openclaw-installer.js.map +1 -1
  123. package/dist/install/public-install.d.ts +14 -4
  124. package/dist/install/public-install.js +20 -7
  125. package/dist/install/public-install.js.map +1 -1
  126. package/dist/interaction/repo-summary.d.ts +3 -17
  127. package/dist/interaction/repo-summary.js +10 -27
  128. package/dist/interaction/repo-summary.js.map +1 -1
  129. package/dist/interaction/service.d.ts +44 -95
  130. package/dist/interaction/service.js +333 -248
  131. package/dist/interaction/service.js.map +1 -1
  132. package/dist/maintenance/scope-merge.d.ts +0 -1
  133. package/dist/maintenance/scope-merge.js +0 -20
  134. package/dist/maintenance/scope-merge.js.map +1 -1
  135. package/dist/plugin/openclaw-plugin.d.ts +23 -0
  136. package/dist/plugin/openclaw-plugin.js +86 -6
  137. package/dist/plugin/openclaw-plugin.js.map +1 -1
  138. package/dist/plugin/openclaw-routine-interaction.d.ts +6 -0
  139. package/dist/plugin/openclaw-routine-interaction.js +296 -0
  140. package/dist/plugin/openclaw-routine-interaction.js.map +1 -0
  141. package/dist/runtime/service.d.ts +0 -1
  142. package/dist/runtime/service.js +20 -29
  143. package/dist/runtime/service.js.map +1 -1
  144. package/dist/store/sqlite/db.js +9 -0
  145. package/dist/store/sqlite/db.js.map +1 -1
  146. package/dist/store/sqlite/repositories/candidate-repo.js +8 -2
  147. package/dist/store/sqlite/repositories/candidate-repo.js.map +1 -1
  148. package/dist/store/sqlite/repositories/injection-repo.d.ts +1 -0
  149. package/dist/store/sqlite/repositories/injection-repo.js +11 -0
  150. package/dist/store/sqlite/repositories/injection-repo.js.map +1 -1
  151. package/dist/store/sqlite/repositories/input-record-repo.d.ts +2 -0
  152. package/dist/store/sqlite/repositories/input-record-repo.js +22 -0
  153. package/dist/store/sqlite/repositories/input-record-repo.js.map +1 -1
  154. package/dist/store/sqlite/repositories/node-repo.js +17 -2
  155. package/dist/store/sqlite/repositories/node-repo.js.map +1 -1
  156. package/dist/store/sqlite/repositories/task-run-repo.d.ts +2 -0
  157. package/dist/store/sqlite/repositories/task-run-repo.js +18 -2
  158. package/dist/store/sqlite/repositories/task-run-repo.js.map +1 -1
  159. package/dist/store/sqlite/schema.sql +9 -49
  160. package/dist/store/vector/api-embedding-provider.d.ts +2 -0
  161. package/dist/store/vector/api-embedding-provider.js +23 -19
  162. package/dist/store/vector/api-embedding-provider.js.map +1 -1
  163. package/dist/store/vector/embeddings.d.ts +1 -1
  164. package/dist/store/vector/embeddings.js +4 -1
  165. package/dist/store/vector/embeddings.js.map +1 -1
  166. package/dist/types/domain.d.ts +30 -46
  167. package/dist/types/plugin.d.ts +2 -1
  168. package/docs/releases/v0.1.2.md +3 -3
  169. package/docs/releases/v0.1.3.md +94 -0
  170. package/docs/user-guide.md +226 -123
  171. package/openclaw.plugin.json +1 -1
  172. package/package.json +3 -2
  173. package/plugins/claude-code-experienceengine/.claude-plugin/plugin.json +1 -1
  174. package/plugins/claude-code-experienceengine/.mcp.json +4 -3
  175. package/plugins/claude-code-experienceengine/scripts/claude-hook.sh +30 -1
  176. package/plugins/claude-code-experienceengine/scripts/install-deps.sh +41 -6
  177. package/dist/cli/commands/pack.d.ts +0 -1
  178. package/dist/cli/commands/pack.js +0 -321
  179. package/dist/cli/commands/pack.js.map +0 -1
  180. package/dist/compiler/agents-renderer.d.ts +0 -4
  181. package/dist/compiler/agents-renderer.js +0 -105
  182. package/dist/compiler/agents-renderer.js.map +0 -1
  183. package/dist/compiler/claude-renderer.d.ts +0 -2
  184. package/dist/compiler/claude-renderer.js +0 -40
  185. package/dist/compiler/claude-renderer.js.map +0 -1
  186. package/dist/compiler/codex-renderer.d.ts +0 -2
  187. package/dist/compiler/codex-renderer.js +0 -40
  188. package/dist/compiler/codex-renderer.js.map +0 -1
  189. package/dist/compiler/compiler.d.ts +0 -4
  190. package/dist/compiler/compiler.js +0 -87
  191. package/dist/compiler/compiler.js.map +0 -1
  192. package/dist/compiler/deployer.d.ts +0 -21
  193. package/dist/compiler/deployer.js +0 -64
  194. package/dist/compiler/deployer.js.map +0 -1
  195. package/dist/compiler/github-renderer.d.ts +0 -2
  196. package/dist/compiler/github-renderer.js +0 -63
  197. package/dist/compiler/github-renderer.js.map +0 -1
  198. package/dist/compiler/types.d.ts +0 -45
  199. package/dist/compiler/types.js +0 -2
  200. package/dist/compiler/types.js.map +0 -1
  201. package/dist/interaction/pack-actions-service.d.ts +0 -59
  202. package/dist/interaction/pack-actions-service.js +0 -172
  203. package/dist/interaction/pack-actions-service.js.map +0 -1
  204. package/dist/packs/fs-registry.d.ts +0 -27
  205. package/dist/packs/fs-registry.js +0 -216
  206. package/dist/packs/fs-registry.js.map +0 -1
  207. package/dist/packs/index-sync.d.ts +0 -9
  208. package/dist/packs/index-sync.js +0 -54
  209. package/dist/packs/index-sync.js.map +0 -1
  210. package/dist/packs/types.d.ts +0 -55
  211. package/dist/packs/types.js +0 -2
  212. package/dist/packs/types.js.map +0 -1
  213. package/dist/store/sqlite/repositories/pack-repo.d.ts +0 -16
  214. package/dist/store/sqlite/repositories/pack-repo.js +0 -192
  215. package/dist/store/sqlite/repositories/pack-repo.js.map +0 -1
@@ -1,87 +0,0 @@
1
- import { mkdirSync, writeFileSync } from "node:fs";
2
- import { join, resolve } from "node:path";
3
- import { ExperiencePackRegistry } from "../packs/fs-registry.js";
4
- import { nowIso } from "../utils/clock.js";
5
- import { renderAgentsMarkdown, selectRenderableNodes } from "./agents-renderer.js";
6
- import { renderClaudeMarkdown } from "./claude-renderer.js";
7
- import { renderCodexMarkdown } from "./codex-renderer.js";
8
- import { renderGitHubAgentMarkdown } from "./github-renderer.js";
9
- const ensureCompilablePackStatus = (status) => {
10
- if (status !== "published" && status !== "rolled_back") {
11
- throw new Error("Only published or rolled-back packs can be compiled");
12
- }
13
- };
14
- const targetOutput = (target, packId) => {
15
- if (target === "claude") {
16
- return {
17
- fileName: "CLAUDE.md",
18
- renderer: renderClaudeMarkdown
19
- };
20
- }
21
- if (target === "github") {
22
- return {
23
- fileName: `${packId}.agent.md`,
24
- renderer: renderGitHubAgentMarkdown
25
- };
26
- }
27
- if (target === "codex") {
28
- return {
29
- fileName: "CODEX.md",
30
- renderer: renderCodexMarkdown
31
- };
32
- }
33
- return {
34
- fileName: "AGENTS.md",
35
- renderer: renderAgentsMarkdown
36
- };
37
- };
38
- export const compilePack = (input) => {
39
- const registry = new ExperiencePackRegistry({ packsDir: input.packsDir });
40
- const generatedAt = input.generatedAt ?? nowIso();
41
- const target = input.target ?? "agents";
42
- const pack = registry.readPack(input.packId);
43
- ensureCompilablePackStatus(pack.status);
44
- const version = input.version ?? pack.currentVersion;
45
- const manifest = registry.readVersionManifest(input.packId, version);
46
- if (manifest.statusSnapshot !== "published") {
47
- throw new Error(`Pack version is not published: ${input.packId}@${version}`);
48
- }
49
- const nodes = registry.readVersionNodes(input.packId, version);
50
- const renderedNodes = selectRenderableNodes(nodes);
51
- if (!renderedNodes.length) {
52
- throw new Error(`No renderable nodes in pack version: ${input.packId}@${version}`);
53
- }
54
- const { fileName, renderer } = targetOutput(target, input.packId);
55
- const outputDir = resolve(join(input.packsDir, input.packId, "compiled", target, version));
56
- const outputPath = join(outputDir, fileName);
57
- const reportPath = join(outputDir, "compile-report.json");
58
- mkdirSync(outputDir, { recursive: true });
59
- const markdown = renderer({
60
- generatedAt,
61
- pack,
62
- manifest,
63
- nodes
64
- });
65
- const report = {
66
- packId: input.packId,
67
- version,
68
- target,
69
- generatedAt,
70
- sourceNodeIds: manifest.sourceNodeIds,
71
- renderedNodeCount: renderedNodes.length,
72
- riskLevel: manifest.riskLevel,
73
- outputPath
74
- };
75
- writeFileSync(outputPath, markdown);
76
- writeFileSync(reportPath, JSON.stringify(report, null, 2));
77
- return {
78
- ...report,
79
- outputDir,
80
- reportPath,
81
- status: pack.status,
82
- outputPath
83
- };
84
- };
85
- export const compilePackToAgents = (input) => compilePack({ ...input, target: "agents" });
86
- export const compilePackToCodex = (input) => compilePack({ ...input, target: "codex" });
87
- //# sourceMappingURL=compiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/compiler/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AASjE,MAAM,0BAA0B,GAAG,CAAC,MAAc,EAAQ,EAAE;IAC1D,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CACnB,MAAgD,EAChD,MAAc,EAC+C,EAAE;IAC/D,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO;YACL,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,oBAAoB;SAC/B,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO;YACL,QAAQ,EAAE,GAAG,MAAM,WAAW;YAC9B,QAAQ,EAAE,yBAAyB;SACpC,CAAC;IACJ,CAAC;IAED,IAAI,MA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,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAiB,EAAE,CAClF,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { CompilerTarget } from "./types.js";
2
- export type DeployCompiledPackInput = {
3
- packsDir: string;
4
- packId: string;
5
- version?: string;
6
- target: CompilerTarget;
7
- repoPath: string;
8
- dryRun?: boolean;
9
- force?: boolean;
10
- statusOnly?: boolean;
11
- };
12
- export type DeployCompiledPackResult = {
13
- target: CompilerTarget;
14
- destinationPath: string;
15
- sourcePath: string;
16
- dryRun: boolean;
17
- overwritten: boolean;
18
- deploymentStatus: "missing" | "up_to_date" | "drifted";
19
- statusOnly: boolean;
20
- };
21
- export declare const deployCompiledPack: (input: DeployCompiledPackInput) => DeployCompiledPackResult;
@@ -1,64 +0,0 @@
1
- import { copyFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
2
- import { dirname, resolve, join } from "node:path";
3
- import { compilePack } from "./compiler.js";
4
- import { ExperiencePackRegistry } from "../packs/fs-registry.js";
5
- const resolveDestinationPath = (repoPath, packId, target) => {
6
- if (target === "claude") {
7
- return join(repoPath, "CLAUDE.md");
8
- }
9
- if (target === "codex") {
10
- return join(repoPath, "CODEX.md");
11
- }
12
- if (target === "github") {
13
- return join(repoPath, ".github", "agents", `${packId}.md`);
14
- }
15
- return join(repoPath, "AGENTS.md");
16
- };
17
- export const deployCompiledPack = (input) => {
18
- const registry = new ExperiencePackRegistry({ packsDir: input.packsDir });
19
- const pack = registry.readPack(input.packId);
20
- const version = input.version ?? pack.currentVersion;
21
- const existingArtifact = registry
22
- .listCompiledArtifacts(input.packId)
23
- .find((artifact) => artifact.version === version && artifact.target === input.target);
24
- const compileResult = existingArtifact
25
- ? {
26
- ...existingArtifact,
27
- packId: input.packId,
28
- riskLevel: registry.readVersionManifest(input.packId, version).riskLevel,
29
- sourceNodeIds: registry.readVersionManifest(input.packId, version).sourceNodeIds,
30
- outputDir: dirname(existingArtifact.outputPath),
31
- status: pack.status
32
- }
33
- : compilePack({
34
- packsDir: input.packsDir,
35
- packId: input.packId,
36
- version,
37
- target: input.target
38
- });
39
- const destinationPath = resolve(resolveDestinationPath(input.repoPath, input.packId, input.target));
40
- const destinationExists = existsSync(destinationPath);
41
- const deploymentStatus = !destinationExists
42
- ? "missing"
43
- : readFileSync(destinationPath, "utf8") === readFileSync(compileResult.outputPath, "utf8")
44
- ? "up_to_date"
45
- : "drifted";
46
- const overwritten = deploymentStatus === "drifted";
47
- if (deploymentStatus === "drifted" && !input.force) {
48
- throw new Error(`Destination differs from compiled artifact: ${destinationPath}`);
49
- }
50
- if (!input.dryRun && !input.statusOnly && deploymentStatus !== "up_to_date") {
51
- mkdirSync(dirname(destinationPath), { recursive: true });
52
- copyFileSync(compileResult.outputPath, destinationPath);
53
- }
54
- return {
55
- target: input.target,
56
- destinationPath,
57
- sourcePath: compileResult.outputPath,
58
- dryRun: input.dryRun ?? false,
59
- overwritten,
60
- deploymentStatus,
61
- statusOnly: input.statusOnly ?? false
62
- };
63
- };
64
- //# sourceMappingURL=deployer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deployer.js","sourceRoot":"","sources":["../../src/compiler/deployer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAuBjE,MAAM,sBAAsB,GAAG,CAC7B,QAAgB,EAChB,MAAc,EACd,MAAsB,EACd,EAAE;IACV,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC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MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK;QAC7B,WAAW;QACX,gBAAgB;QAChB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,KAAK;KACtC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { RenderAgentsMarkdownInput } from "./types.js";
2
- export declare const renderGitHubAgentMarkdown: (input: RenderAgentsMarkdownInput) => string;
@@ -1,63 +0,0 @@
1
- import { selectRenderableNodes } from "./agents-renderer.js";
2
- const shortenTitle = (value) => {
3
- const marker = value.indexOf(": ");
4
- const raw = marker >= 0 ? value.slice(marker + 2) : value;
5
- return raw.length <= 72 ? raw : `${raw.slice(0, 69).trimEnd()}...`;
6
- };
7
- const shortenApplicability = (value, taskType) => {
8
- if (value.length <= 96) {
9
- return value;
10
- }
11
- return `${taskType} tasks matching the same historical signal`;
12
- };
13
- const renderSection = (title, nodes) => {
14
- if (!nodes.length) {
15
- return [];
16
- }
17
- const lines = [`## ${title}`, ""];
18
- for (const node of nodes) {
19
- lines.push(`### ${shortenTitle(node.title)}`);
20
- lines.push(`- Applies to: ${shortenApplicability(node.applicability, node.taskType)}`);
21
- lines.push(`- Confidence: ${node.confidence}`);
22
- lines.push(`- Instruction: ${node.guidance}`);
23
- lines.push("");
24
- }
25
- return lines;
26
- };
27
- export const renderGitHubAgentMarkdown = (input) => {
28
- const renderedNodes = selectRenderableNodes(input.nodes);
29
- const strategies = renderedNodes.filter((node) => node.nodeType === "strategy");
30
- const warnings = renderedNodes.filter((node) => node.nodeType === "warning");
31
- const frontmatter = [
32
- "---",
33
- `name: ${input.pack.name}`,
34
- `description: Reviewed ExperienceEngine guidance compiled from pack ${input.pack.packId}.`,
35
- "tools:",
36
- " - read",
37
- " - search",
38
- " - edit",
39
- " - run",
40
- "---",
41
- ""
42
- ];
43
- const body = [
44
- "# GitHub Copilot Custom Agent Profile",
45
- "",
46
- "## Operating Rules",
47
- "- Apply these instructions only when the task clearly matches the listed signals.",
48
- "- Prefer the smallest verifiable change and rerun the validation loop before widening scope.",
49
- "- If a warning conflicts with a strategy, resolve the warning first.",
50
- "",
51
- ...renderSection("Preferred Strategies", strategies),
52
- ...renderSection("Risk Warnings", warnings),
53
- "## Provenance",
54
- `- Pack ID: ${input.pack.packId}`,
55
- `- Version: ${input.manifest.version}`,
56
- `- Risk level: ${input.manifest.riskLevel}`,
57
- `- Generated at: ${input.generatedAt}`,
58
- `- Evidence: ${input.manifest.evidenceSummary || "none"}`,
59
- ""
60
- ];
61
- return [...frontmatter, ...body].join("\n");
62
- };
63
- //# sourceMappingURL=github-renderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"github-renderer.js","sourceRoot":"","sources":["../../src/compiler/github-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1D,OAAO,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE;IACvE,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,GAAG,QAAQ,4CAA4C,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CACpB,KAAa,EACb,KAA8D,EACpD,EAAE;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V,SAAS;QACT,KAAK;QACL,EAAE;KACH,CAAC;IAEF,MAAM,IAAI,GAAG;QACX,uCAAuC;QACvC,EAAE;QACF,oBAAoB;QACpB,mFAAmF;QACnF,8FAA8F;QAC9F,sEAAsE;QACtE,EAAE;QACF,GAAG,aAAa,CAAC,sBAAsB,EAAE,UAAU,CAAC;QACpD,GAAG,aAAa,CAAC,eAAe,EAAE,QAAQ,CAAC;QAC3C,eAAe;QACf,cAAc,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;QACjC,cAAc,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE;QACtC,iBAAiB,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE;QAC3C,mBAAmB,KAAK,CAAC,WAAW,EAAE;QACtC,eAAe,KAAK,CAAC,QAAQ,CAAC,eAAe,IAAI,MAAM,EAAE;QACzD,EAAE;KACH,CAAC;IAEF,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC"}
@@ -1,45 +0,0 @@
1
- import type { ExperienceNodeType, ExperiencePackRiskLevel, ExperiencePackStatus, TaskType } from "../types/domain.js";
2
- import type { ExperiencePackNodeSnapshot, ExperiencePackSummary, ExperiencePackVersionManifest } from "../packs/types.js";
3
- export type CompilerTarget = "agents" | "codex" | "github" | "claude";
4
- export type CompilePackInput = {
5
- packsDir: string;
6
- packId: string;
7
- version?: string;
8
- target?: CompilerTarget;
9
- generatedAt?: string;
10
- };
11
- export type CompilePackToAgentsInput = Omit<CompilePackInput, "target">;
12
- export type CompilePackToCodexInput = Omit<CompilePackInput, "target">;
13
- export type ConfidenceLevel = "high" | "medium" | "low";
14
- export type RenderedAgentsNode = {
15
- id: string;
16
- nodeType: ExperienceNodeType;
17
- title: string;
18
- applicability: string;
19
- guidanceLabel: "Guidance" | "Avoid";
20
- guidance: string;
21
- confidence: ConfidenceLevel;
22
- taskType: TaskType;
23
- };
24
- export type RenderAgentsMarkdownInput = {
25
- generatedAt: string;
26
- pack: ExperiencePackSummary;
27
- manifest: ExperiencePackVersionManifest;
28
- nodes: ExperiencePackNodeSnapshot[];
29
- };
30
- export type CompileReport = {
31
- packId: string;
32
- version: string;
33
- target: CompilerTarget;
34
- generatedAt: string;
35
- sourceNodeIds: string[];
36
- renderedNodeCount: number;
37
- riskLevel: ExperiencePackRiskLevel;
38
- outputPath: string;
39
- };
40
- export type CompileResult = CompileReport & {
41
- outputDir: string;
42
- outputPath: string;
43
- reportPath: string;
44
- status: ExperiencePackStatus;
45
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/compiler/types.ts"],"names":[],"mappings":""}
@@ -1,59 +0,0 @@
1
- import type { CompilerTarget } from "../compiler/types.js";
2
- export type HighImpactPackOperation = "publish" | "rollback" | "deploy";
3
- type ServiceOptions = {
4
- env?: NodeJS.ProcessEnv;
5
- homeDir?: string;
6
- tokenFactory?: () => string;
7
- now?: () => string;
8
- };
9
- type PlannedPackOperation = {
10
- planId: string;
11
- confirmationToken: string;
12
- operation: HighImpactPackOperation;
13
- packId: string;
14
- version?: string;
15
- target?: CompilerTarget;
16
- repoPath?: string;
17
- summary: string;
18
- effects: string[];
19
- requiresConfirmation: true;
20
- createdAt: string;
21
- };
22
- export type PackOperationPlanResult = PlannedPackOperation & {
23
- commandHint: string;
24
- };
25
- export type PackOperationExecutionResult = {
26
- status: "executed";
27
- operation: HighImpactPackOperation;
28
- packId: string;
29
- summary: string;
30
- result: {
31
- status: string;
32
- currentVersion: string;
33
- } | {
34
- target: CompilerTarget;
35
- destinationPath: string;
36
- sourcePath: string;
37
- deploymentStatus: "missing" | "up_to_date" | "drifted";
38
- overwritten: boolean;
39
- };
40
- };
41
- export declare class ExperiencePackActionsService {
42
- private readonly options;
43
- private readonly registry;
44
- private readonly repo;
45
- private readonly indexSync;
46
- private readonly packsDir;
47
- private readonly plans;
48
- constructor(options?: ServiceOptions);
49
- private issueToken;
50
- private now;
51
- planPublish(packId: string): PackOperationPlanResult;
52
- planRollback(packId: string, version: string): PackOperationPlanResult;
53
- planDeploy(packId: string, target: CompilerTarget, repoPath: string, version?: string): PackOperationPlanResult;
54
- executePlannedOperation(args: {
55
- planId: string;
56
- confirmationToken: string;
57
- }): PackOperationExecutionResult;
58
- }
59
- export {};
@@ -1,172 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- import { loadConfig } from "../config/load-config.js";
3
- import { resolveExperienceEnginePaths } from "../config/path-resolver.js";
4
- import { deployCompiledPack } from "../compiler/deployer.js";
5
- import { ExperiencePackRegistry } from "../packs/fs-registry.js";
6
- import { ExperiencePackIndexSync } from "../packs/index-sync.js";
7
- import { bootstrapDatabase, openDatabase } from "../store/sqlite/db.js";
8
- import { ExperiencePackRepository } from "../store/sqlite/repositories/pack-repo.js";
9
- const buildCommandHint = (packId, operation, version, target, repoPath) => operation === "publish"
10
- ? `ee pack publish ${packId}`
11
- : operation === "rollback"
12
- ? `ee pack rollback ${packId} ${version ?? "<version>"}`
13
- : `ee pack deploy ${packId} ${version ?? "<current>"} ${target ?? "<target>"} ${repoPath ?? "<repo-path>"}`;
14
- export class ExperiencePackActionsService {
15
- options;
16
- registry;
17
- repo;
18
- indexSync;
19
- packsDir;
20
- plans = new Map();
21
- constructor(options = {}) {
22
- this.options = options;
23
- const paths = resolveExperienceEnginePaths({
24
- adapter: "codex",
25
- env: options.env ?? process.env,
26
- homeDir: options.homeDir
27
- });
28
- const db = openDatabase(loadConfig({
29
- dataDir: paths.dataDir,
30
- sqlitePath: paths.sqlitePath,
31
- captureDir: paths.captureDir
32
- }, {
33
- env: options.env ?? process.env,
34
- homeDir: options.homeDir
35
- }));
36
- bootstrapDatabase(db);
37
- this.packsDir = paths.packsDir;
38
- this.registry = new ExperiencePackRegistry({ packsDir: paths.packsDir });
39
- this.repo = new ExperiencePackRepository(db);
40
- this.indexSync = new ExperiencePackIndexSync(this.registry, this.repo);
41
- }
42
- issueToken() {
43
- return (this.options.tokenFactory ?? (() => randomUUID()))();
44
- }
45
- now() {
46
- return (this.options.now ?? (() => new Date().toISOString()))();
47
- }
48
- planPublish(packId) {
49
- const pack = this.registry.readPack(packId);
50
- const plan = {
51
- planId: this.issueToken(),
52
- confirmationToken: this.issueToken(),
53
- operation: "publish",
54
- packId,
55
- summary: `Publish Experience Pack ${packId}@${pack.currentVersion}.`,
56
- effects: [
57
- "Updates the pack registry status to published.",
58
- "Refreshes the local SQLite pack index for runtime and inspect surfaces."
59
- ],
60
- requiresConfirmation: true,
61
- createdAt: this.now()
62
- };
63
- this.plans.set(plan.planId, plan);
64
- return {
65
- ...plan,
66
- commandHint: buildCommandHint(packId, "publish")
67
- };
68
- }
69
- planRollback(packId, version) {
70
- this.registry.readVersionManifest(packId, version);
71
- const plan = {
72
- planId: this.issueToken(),
73
- confirmationToken: this.issueToken(),
74
- operation: "rollback",
75
- packId,
76
- version,
77
- summary: `Rollback Experience Pack ${packId} to ${version}.`,
78
- effects: [
79
- "Switches the current pack version to the selected published version.",
80
- "Refreshes the local SQLite pack index for runtime and inspect surfaces."
81
- ],
82
- requiresConfirmation: true,
83
- createdAt: this.now()
84
- };
85
- this.plans.set(plan.planId, plan);
86
- return {
87
- ...plan,
88
- commandHint: buildCommandHint(packId, "rollback", version)
89
- };
90
- }
91
- planDeploy(packId, target, repoPath, version) {
92
- const pack = this.registry.readPack(packId);
93
- const effectiveVersion = version ?? pack.currentVersion;
94
- this.registry.readVersionManifest(packId, effectiveVersion);
95
- const preview = deployCompiledPack({
96
- packsDir: this.packsDir,
97
- packId,
98
- version: effectiveVersion,
99
- target,
100
- repoPath,
101
- dryRun: true
102
- });
103
- const plan = {
104
- planId: this.issueToken(),
105
- confirmationToken: this.issueToken(),
106
- operation: "deploy",
107
- packId,
108
- version: effectiveVersion,
109
- target,
110
- repoPath,
111
- summary: `Deploy Experience Pack ${packId}@${effectiveVersion} to ${target} in ${repoPath}.`,
112
- effects: [
113
- `Writes the compiled ${target} artifact to ${preview.destinationPath}.`,
114
- preview.deploymentStatus === "drifted"
115
- ? "Overwrites drifted destination content because this path requires explicit confirmation."
116
- : `Current destination state: ${preview.deploymentStatus}.`
117
- ],
118
- requiresConfirmation: true,
119
- createdAt: this.now()
120
- };
121
- this.plans.set(plan.planId, plan);
122
- return {
123
- ...plan,
124
- commandHint: buildCommandHint(packId, "deploy", effectiveVersion, target, repoPath)
125
- };
126
- }
127
- executePlannedOperation(args) {
128
- const plan = this.plans.get(args.planId);
129
- if (!plan || plan.confirmationToken !== args.confirmationToken) {
130
- throw new Error("Invalid or expired confirmation token. Request a fresh pack operation plan first.");
131
- }
132
- this.plans.delete(args.planId);
133
- if (plan.operation === "deploy") {
134
- const result = deployCompiledPack({
135
- packsDir: this.packsDir,
136
- packId: plan.packId,
137
- version: plan.version,
138
- target: plan.target,
139
- repoPath: plan.repoPath,
140
- force: true
141
- });
142
- return {
143
- status: "executed",
144
- operation: plan.operation,
145
- packId: plan.packId,
146
- summary: plan.summary,
147
- result: {
148
- target: result.target,
149
- destinationPath: result.destinationPath,
150
- sourcePath: result.sourcePath,
151
- deploymentStatus: result.deploymentStatus,
152
- overwritten: result.overwritten
153
- }
154
- };
155
- }
156
- const pack = plan.operation === "publish"
157
- ? this.registry.publishPack(plan.packId)
158
- : this.registry.rollbackPack(plan.packId, plan.version);
159
- this.indexSync.syncPack(plan.packId);
160
- return {
161
- status: "executed",
162
- operation: plan.operation,
163
- packId: plan.packId,
164
- summary: plan.summary,
165
- result: {
166
- status: pack.status,
167
- currentVersion: pack.currentVersion
168
- }
169
- };
170
- }
171
- }
172
- //# sourceMappingURL=pack-actions-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pack-actions-service.js","sourceRoot":"","sources":["../../src/interaction/pack-actions-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE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B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE;gBACN,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,cAAc,EAAE,IAAI,CAAC,cAAc;aACpC;SACF,CAAC;IACJ,CAAC;CACF"}
@@ -1,27 +0,0 @@
1
- import type { ExperiencePackCompiledArtifact, ExperiencePackCompileStatus, ExperiencePackDraftCreateInput, ExperiencePackRiskLevel, ExperiencePackNodeSnapshot, ExperiencePackSummary, ExperiencePackVersionManifest } from "./types.js";
2
- export declare class ExperiencePackRegistry {
3
- private readonly packsDir;
4
- constructor(args: {
5
- packsDir: string;
6
- });
7
- private ensureRegistryRoot;
8
- private packDir;
9
- private versionDir;
10
- private compiledRoot;
11
- private readJson;
12
- listPacks(): ExperiencePackSummary[];
13
- createDraft(input: ExperiencePackDraftCreateInput): ExperiencePackSummary;
14
- readPack(packId: string): ExperiencePackSummary;
15
- readVersionManifest(packId: string, version: string): ExperiencePackVersionManifest;
16
- listVersions(packId: string): ExperiencePackVersionManifest[];
17
- readVersionNodes(packId: string, version: string): ExperiencePackNodeSnapshot[];
18
- listCompiledArtifacts(packId: string): ExperiencePackCompiledArtifact[];
19
- getCompileStatus(packId: string, currentVersion: string): ExperiencePackCompileStatus;
20
- reviewPack(packId: string, updates: {
21
- description?: string;
22
- evidenceSummary?: string;
23
- riskLevel?: ExperiencePackRiskLevel;
24
- }): ExperiencePackSummary;
25
- publishPack(packId: string): ExperiencePackSummary;
26
- rollbackPack(packId: string, version: string): ExperiencePackSummary;
27
- }