@itsshadowai/refinery 0.1.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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +228 -0
  3. package/coral/agents/claim-scout/coral-agent.toml +23 -0
  4. package/coral/agents/decision-synthesizer/coral-agent.toml +23 -0
  5. package/coral/agents/evidence-auditor/coral-agent.toml +23 -0
  6. package/coral/agents/memory-cartographer/coral-agent.toml +23 -0
  7. package/coral/agents/proposal-editor/coral-agent.toml +23 -0
  8. package/coral/agents/run-worker.sh +19 -0
  9. package/coral/refinery-config.toml +16 -0
  10. package/dist/adapters/codex-memory.d.ts +6 -0
  11. package/dist/adapters/codex-memory.js +264 -0
  12. package/dist/adapters/codex-memory.js.map +1 -0
  13. package/dist/cli.d.ts +2 -0
  14. package/dist/cli.js +671 -0
  15. package/dist/cli.js.map +1 -0
  16. package/dist/coral/client.d.ts +107 -0
  17. package/dist/coral/client.js +214 -0
  18. package/dist/coral/client.js.map +1 -0
  19. package/dist/coral/definitions.d.ts +25 -0
  20. package/dist/coral/definitions.js +53 -0
  21. package/dist/coral/definitions.js.map +1 -0
  22. package/dist/coral/mcp.d.ts +17 -0
  23. package/dist/coral/mcp.js +71 -0
  24. package/dist/coral/mcp.js.map +1 -0
  25. package/dist/coral/review-conductor.d.ts +120 -0
  26. package/dist/coral/review-conductor.js +1290 -0
  27. package/dist/coral/review-conductor.js.map +1 -0
  28. package/dist/coral/smoke.d.ts +1 -0
  29. package/dist/coral/smoke.js +265 -0
  30. package/dist/coral/smoke.js.map +1 -0
  31. package/dist/coral/topology.d.ts +5 -0
  32. package/dist/coral/topology.js +15 -0
  33. package/dist/coral/topology.js.map +1 -0
  34. package/dist/coral/worker.d.ts +34 -0
  35. package/dist/coral/worker.js +671 -0
  36. package/dist/coral/worker.js.map +1 -0
  37. package/dist/core/adapter.d.ts +93 -0
  38. package/dist/core/adapter.js +112 -0
  39. package/dist/core/adapter.js.map +1 -0
  40. package/dist/core/artifacts.d.ts +93 -0
  41. package/dist/core/artifacts.js +200 -0
  42. package/dist/core/artifacts.js.map +1 -0
  43. package/dist/core/deliberation.d.ts +89 -0
  44. package/dist/core/deliberation.js +385 -0
  45. package/dist/core/deliberation.js.map +1 -0
  46. package/dist/core/errors.d.ts +26 -0
  47. package/dist/core/errors.js +50 -0
  48. package/dist/core/errors.js.map +1 -0
  49. package/dist/core/intents.d.ts +5 -0
  50. package/dist/core/intents.js +34 -0
  51. package/dist/core/intents.js.map +1 -0
  52. package/dist/core/live-review.d.ts +93 -0
  53. package/dist/core/live-review.js +269 -0
  54. package/dist/core/live-review.js.map +1 -0
  55. package/dist/core/model-client.d.ts +19 -0
  56. package/dist/core/model-client.js +45 -0
  57. package/dist/core/model-client.js.map +1 -0
  58. package/dist/core/paths.d.ts +16 -0
  59. package/dist/core/paths.js +43 -0
  60. package/dist/core/paths.js.map +1 -0
  61. package/dist/core/review.d.ts +93 -0
  62. package/dist/core/review.js +102 -0
  63. package/dist/core/review.js.map +1 -0
  64. package/dist/core/specialists/claim-scout.d.ts +2 -0
  65. package/dist/core/specialists/claim-scout.js +26 -0
  66. package/dist/core/specialists/claim-scout.js.map +1 -0
  67. package/dist/core/specialists/decision-synthesizer.d.ts +2 -0
  68. package/dist/core/specialists/decision-synthesizer.js +35 -0
  69. package/dist/core/specialists/decision-synthesizer.js.map +1 -0
  70. package/dist/core/specialists/evidence-auditor.d.ts +2 -0
  71. package/dist/core/specialists/evidence-auditor.js +35 -0
  72. package/dist/core/specialists/evidence-auditor.js.map +1 -0
  73. package/dist/core/specialists/harness.d.ts +2 -0
  74. package/dist/core/specialists/harness.js +13 -0
  75. package/dist/core/specialists/harness.js.map +1 -0
  76. package/dist/core/specialists/index.d.ts +8 -0
  77. package/dist/core/specialists/index.js +8 -0
  78. package/dist/core/specialists/index.js.map +1 -0
  79. package/dist/core/specialists/memory-cartographer.d.ts +2 -0
  80. package/dist/core/specialists/memory-cartographer.js +33 -0
  81. package/dist/core/specialists/memory-cartographer.js.map +1 -0
  82. package/dist/core/specialists/prompt.d.ts +3 -0
  83. package/dist/core/specialists/prompt.js +25 -0
  84. package/dist/core/specialists/prompt.js.map +1 -0
  85. package/dist/core/specialists/proposal-editor.d.ts +2 -0
  86. package/dist/core/specialists/proposal-editor.js +37 -0
  87. package/dist/core/specialists/proposal-editor.js.map +1 -0
  88. package/dist/core/specialists/types.d.ts +20 -0
  89. package/dist/core/specialists/types.js +2 -0
  90. package/dist/core/specialists/types.js.map +1 -0
  91. package/dist/env.d.ts +11 -0
  92. package/dist/env.js +53 -0
  93. package/dist/env.js.map +1 -0
  94. package/dist/mcp.d.ts +9 -0
  95. package/dist/mcp.js +147 -0
  96. package/dist/mcp.js.map +1 -0
  97. package/package.json +50 -0
  98. package/skills/refinery/SKILL.md +117 -0
  99. package/skills/refinery/agents/openai.yaml +4 -0
@@ -0,0 +1,120 @@
1
+ import { type ChildProcessWithoutNullStreams } from "node:child_process";
2
+ import { type ReviewTopology } from "./topology.ts";
3
+ import { refineryReviewSchemaVersion, type MemoryStoreAdapter } from "../core/adapter.ts";
4
+ import { type ReviewRunResult, type ReviewSinkOptions, type ReviewSinkResult } from "../core/review.ts";
5
+ import { type ReviewIntent } from "../core/intents.ts";
6
+ export interface CoralReviewRuntimeOptions {
7
+ apiUrl?: string;
8
+ authKey?: string;
9
+ configPath?: string;
10
+ namespace?: string;
11
+ sessionId?: string;
12
+ threadId?: string;
13
+ startServer?: boolean;
14
+ noTeardown?: boolean;
15
+ coralPackage?: string;
16
+ timeoutMs?: number;
17
+ modelName?: string;
18
+ modelBaseUrl?: string;
19
+ reasoningEffort?: string;
20
+ maxTurns?: string;
21
+ topology?: ReviewTopology;
22
+ }
23
+ export interface CoralReviewRunOptions {
24
+ adapter: MemoryStoreAdapter;
25
+ project: string;
26
+ source: "codex-memory";
27
+ target: "codex-memory";
28
+ scope: string;
29
+ runId: string;
30
+ outputDir: string;
31
+ intent?: ReviewIntent;
32
+ request?: string | null;
33
+ sink?: ReviewSinkOptions;
34
+ sourceLimit?: number;
35
+ sourceCharLimit?: number;
36
+ coral?: CoralReviewRuntimeOptions;
37
+ }
38
+ export interface CoralReviewRunResult extends ReviewRunResult {
39
+ mode: "coral";
40
+ source: "codex-memory";
41
+ target: "codex-memory";
42
+ project: string;
43
+ evidenceReview: unknown;
44
+ coral: {
45
+ namespace: string;
46
+ sessionId: string;
47
+ threadId: string;
48
+ threadIds?: string[];
49
+ agents: string[];
50
+ };
51
+ sink?: ReviewSinkResult;
52
+ }
53
+ export interface CoralConsoleRunOptions {
54
+ adapter: MemoryStoreAdapter;
55
+ project: string;
56
+ source: "codex-memory";
57
+ target: "codex-memory";
58
+ scope: string;
59
+ runId: string;
60
+ intent?: ReviewIntent;
61
+ request?: string | null;
62
+ sourceLimit?: number;
63
+ sourceCharLimit?: number;
64
+ coral?: CoralReviewRuntimeOptions;
65
+ }
66
+ export interface CoralConsoleRunResult {
67
+ ok: true;
68
+ schemaVersion: typeof refineryReviewSchemaVersion;
69
+ command: "console run";
70
+ mode: "coral-console";
71
+ source: "codex-memory";
72
+ target: "codex-memory";
73
+ project: string;
74
+ adapter: {
75
+ name: string;
76
+ };
77
+ scope: string;
78
+ dryRun: true;
79
+ archive: false;
80
+ artifactDir: null;
81
+ writesAttempted: false;
82
+ runId: string;
83
+ consoleUrl: string;
84
+ schemaUrl: string;
85
+ counts: {
86
+ sources: number;
87
+ activeMemories: number;
88
+ seededMessages: number;
89
+ };
90
+ coral: {
91
+ apiUrl: string;
92
+ namespace: string;
93
+ sessionId: string;
94
+ threadId: string;
95
+ threadIds: string[];
96
+ proposalThreadId?: string;
97
+ critiqueThreadId?: string;
98
+ agents: string[];
99
+ topology: ReviewTopology;
100
+ serverMode: "managed" | "attached";
101
+ managedServerStarted: boolean;
102
+ };
103
+ seededMessages: Array<{
104
+ id: string;
105
+ threadId: string;
106
+ senderName: string;
107
+ mentionNames: string[];
108
+ textExcerpt: string;
109
+ }>;
110
+ next: string;
111
+ }
112
+ export interface CoralConsoleRunSession {
113
+ result: CoralConsoleRunResult;
114
+ managedServerStarted: boolean;
115
+ managedProcess: ChildProcessWithoutNullStreams | null;
116
+ close: () => Promise<void>;
117
+ }
118
+ export declare function defaultCoralReviewTimeoutMs(topology: ReviewTopology): number;
119
+ export declare function startCoralConsoleRun(options: CoralConsoleRunOptions): Promise<CoralConsoleRunSession>;
120
+ export declare function runCoralReview(options: CoralReviewRunOptions): Promise<CoralReviewRunResult>;