greprag 5.21.0 → 5.22.1
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/README.md +56 -13
- package/dist/codex-steering.d.ts +29 -0
- package/dist/codex-steering.js +168 -0
- package/dist/codex-steering.js.map +1 -0
- package/dist/commands/codex.d.ts +34 -0
- package/dist/commands/codex.js +490 -0
- package/dist/commands/codex.js.map +1 -0
- package/dist/commands/discover.d.ts +1 -1
- package/dist/commands/discover.js +1 -1
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +8 -2
- package/dist/commands/init.js +510 -79
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lore.d.ts +2 -0
- package/dist/commands/lore.js +83 -6
- package/dist/commands/lore.js.map +1 -1
- package/dist/commands/status.d.ts +22 -10
- package/dist/commands/status.js +159 -69
- package/dist/commands/status.js.map +1 -1
- package/dist/hook.js +120 -13
- package/dist/hook.js.map +1 -1
- package/dist/index.js +109 -25
- package/dist/index.js.map +1 -1
- package/dist/opencode-plugin.d.ts +2 -2
- package/dist/opencode-plugin.js +47 -14
- package/dist/opencode-plugin.js.map +1 -1
- package/dist/project-anchor.d.ts +11 -9
- package/dist/project-anchor.js +58 -27
- package/dist/project-anchor.js.map +1 -1
- package/package.json +4 -2
- package/scripts/postinstall.js +61 -46
- package/skill/greprag/SKILL.md +22 -4
- package/skill/greprag/docs/doctor.md +1 -1
- package/skill/greprag/docs/setup.md +98 -6
- package/skill/lore-advisor/SKILL.md +101 -43
package/README.md
CHANGED
|
@@ -1,47 +1,90 @@
|
|
|
1
1
|
# GrepRAG
|
|
2
2
|
|
|
3
|
-
Agent memory as a service. Episodic project memory for Claude Code and OpenCode —
|
|
3
|
+
Agent memory as a service. Episodic project memory for Claude Code, Codex, and OpenCode — captures supported agent turns, compacts into hourly/daily/weekly summaries, and exposes two access patterns: lexical search by topic (`greprag memory search "<query>"`) or a session recap (`greprag memory recap`). The memory product line is marketed as **Odyssey**. Also handles cross-project async messaging via inbox.
|
|
4
4
|
|
|
5
|
-
## Quick
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm i -g greprag
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Then either run `/greprag` inside a supported agent, or run `greprag init` in a terminal. Bare `greprag init` detects Claude Code, Codex, and OpenCode; if more than one is present in a non-interactive shell, it prints the explicit command to use.
|
|
12
|
+
|
|
11
13
|
### Claude Code
|
|
12
14
|
|
|
13
15
|
Run `/greprag` in any Claude Code session, or:
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
greprag init
|
|
18
|
+
greprag init --claude
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Codex
|
|
22
|
+
|
|
23
|
+
Run `/greprag` in Codex after install, or:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
greprag init --codex --tenant-id <your-handle> --install-watcher
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Example: `greprag init --codex --tenant-id tanya --install-watcher`.
|
|
30
|
+
The handle becomes your public GrepRAG address, such as
|
|
31
|
+
`tanya@greprag.com`.
|
|
32
|
+
|
|
33
|
+
Codex requires one extra trust step: after init/update, open Codex Desktop
|
|
34
|
+
Settings -> Settings -> Hooks, trust the 6 GrepRAG hooks, then start a fresh
|
|
35
|
+
session.
|
|
36
|
+
|
|
37
|
+
If you did not pass `--install-watcher`, install the login watcher later:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
greprag codex startup install
|
|
17
41
|
```
|
|
18
42
|
|
|
43
|
+
Run `greprag codex doctor` to verify the hook file, current Codex thread, and
|
|
44
|
+
startup watcher. For foreground
|
|
45
|
+
testing, run:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
greprag codex watch --session <8hex-or-full-codex-session-id>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If `--session` is omitted, GrepRAG uses the latest Codex session. The watcher
|
|
52
|
+
wakes Codex with `codex exec resume` when messages arrive.
|
|
53
|
+
|
|
19
54
|
### OpenCode
|
|
20
55
|
|
|
21
56
|
```bash
|
|
22
57
|
greprag init --opencode
|
|
23
58
|
```
|
|
24
59
|
|
|
25
|
-
This
|
|
60
|
+
This installs the memory plugin at `~/.config/opencode/plugins/greprag-memory.js`.
|
|
61
|
+
|
|
62
|
+
All platforms share project identity through `.greprag/project.json` when a file anchor is needed, or git-derived identity when available. Legacy `.claude/project.json` anchors still read and migrate on init.
|
|
26
63
|
|
|
27
|
-
Status check
|
|
64
|
+
Status check:
|
|
28
65
|
|
|
29
66
|
```bash
|
|
30
|
-
greprag status
|
|
67
|
+
greprag status --all-platforms
|
|
31
68
|
```
|
|
32
69
|
|
|
33
70
|
## What's active
|
|
34
71
|
|
|
35
|
-
- **Memory** (episodic project memory, marketed as Odyssey):
|
|
36
|
-
- **
|
|
72
|
+
- **Memory** (episodic project memory, marketed as Odyssey): supported agent turns captured via platform hooks/plugin, compacted into hourly/daily/weekly summaries. Query via `greprag memory search "<query>"` (lexical retrieval, v5 RRF+adjacency pipeline) or `recap` / `daily` / `weekly` / `hourly` / `turns` / `ships` (by time window). (`greprag memory briefing` and `greprag odyssey ...` are silent back-compat aliases.)
|
|
73
|
+
- **Memory recap**: surfaces recent memory rows through platform hooks or `/greprag`
|
|
37
74
|
- **Inbox**: cross-project async messaging between your projects or other GrepRAG users
|
|
38
75
|
|
|
39
76
|
## Commands
|
|
40
77
|
|
|
41
78
|
| Command | Description |
|
|
42
79
|
|---------|-------------|
|
|
43
|
-
| `greprag status` | Check auth, hooks, project anchor |
|
|
44
|
-
| `greprag init` |
|
|
80
|
+
| `greprag status --all-platforms` | Check auth, hooks/plugins, skills, and project anchor |
|
|
81
|
+
| `greprag init` | Detect/ask which agent to configure |
|
|
82
|
+
| `greprag init --claude` | Configure Claude Code hooks + skill |
|
|
83
|
+
| `greprag init --codex --tenant-id <handle> --install-watcher` | Configure Codex hooks + skill + live watcher |
|
|
84
|
+
| `greprag codex watch --session <id>` | Live-push inbox messages into Codex |
|
|
85
|
+
| `greprag codex doctor` | Diagnose Codex hooks, session id, trust path, and watcher state |
|
|
86
|
+
| `greprag codex startup install` | Start the Codex live watcher at login |
|
|
87
|
+
| `greprag init --opencode` | Configure OpenCode plugin |
|
|
45
88
|
| `greprag init --global` | Global anchor for ephemeral sessions |
|
|
46
89
|
| `greprag doctor` | Diagnose project_id drift and orphan consolidation |
|
|
47
90
|
| `greprag memory search "<query>"` | Lexical search over the project's memory (v5 RRF+adjacency pipeline) |
|
|
@@ -55,12 +98,12 @@ greprag status # check what's configured
|
|
|
55
98
|
## Requirements
|
|
56
99
|
|
|
57
100
|
- Node.js 18+
|
|
58
|
-
- Claude Code
|
|
59
|
-
-
|
|
101
|
+
- Claude Code, Codex, or OpenCode
|
|
102
|
+
- A GrepRAG handle or API key. `--tenant-id <handle>` provisions the key.
|
|
60
103
|
|
|
61
104
|
## How it works
|
|
62
105
|
|
|
63
|
-
The CLI is a thin HTTP client. All intelligence —
|
|
106
|
+
The CLI is a thin HTTP client. All intelligence — scoring, compaction, and retrieval — lives server-side. Platform hooks/plugins call the API; the server handles everything else.
|
|
64
107
|
|
|
65
108
|
## Links
|
|
66
109
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface CodexSteeringInput {
|
|
2
|
+
session_id?: string;
|
|
3
|
+
cwd?: string;
|
|
4
|
+
hook_event_name?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GrepragHookConfig {
|
|
7
|
+
apiUrl: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface InboxMessage {
|
|
12
|
+
id: string;
|
|
13
|
+
from?: {
|
|
14
|
+
handle?: string;
|
|
15
|
+
tenant?: string;
|
|
16
|
+
project_id?: string | null;
|
|
17
|
+
session_id?: string | null;
|
|
18
|
+
};
|
|
19
|
+
to_session_id?: string | null;
|
|
20
|
+
body: string;
|
|
21
|
+
references?: unknown;
|
|
22
|
+
message_type?: string;
|
|
23
|
+
created_at?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function formatCodexInboxSteering(messages: InboxMessage[], session8: string): string | null;
|
|
26
|
+
export declare function buildCodexInboxSteering(input: CodexSteeringInput, cfg: GrepragHookConfig, opts?: {
|
|
27
|
+
debounce?: boolean;
|
|
28
|
+
}): Promise<string | null>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.formatCodexInboxSteering = formatCodexInboxSteering;
|
|
37
|
+
exports.buildCodexInboxSteering = buildCodexInboxSteering;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const project_anchor_1 = require("./project-anchor");
|
|
41
|
+
const session_id_1 = require("./session-id");
|
|
42
|
+
const CODEX_INBOX_DEBOUNCE_MS = 15_000;
|
|
43
|
+
function stateDir() {
|
|
44
|
+
const home = process.env.HOME || process.env.USERPROFILE || '';
|
|
45
|
+
return home ? path.join(home, '.greprag', 'codex') : null;
|
|
46
|
+
}
|
|
47
|
+
function inboxStatePath(sessionId) {
|
|
48
|
+
const dir = stateDir();
|
|
49
|
+
if (!dir)
|
|
50
|
+
return null;
|
|
51
|
+
const safe = sessionId.replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 160);
|
|
52
|
+
return path.join(dir, `${safe}.inbox.json`);
|
|
53
|
+
}
|
|
54
|
+
function wasRecentlyPolled(sessionId, now = Date.now()) {
|
|
55
|
+
const file = inboxStatePath(sessionId);
|
|
56
|
+
if (!file)
|
|
57
|
+
return false;
|
|
58
|
+
try {
|
|
59
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
60
|
+
const last = parsed.lastPollAt ? Date.parse(parsed.lastPollAt) : NaN;
|
|
61
|
+
return Number.isFinite(last) && now - last < CODEX_INBOX_DEBOUNCE_MS;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function stampPoll(sessionId) {
|
|
68
|
+
const file = inboxStatePath(sessionId);
|
|
69
|
+
if (!file)
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
const dir = path.dirname(file);
|
|
73
|
+
if (!fs.existsSync(dir))
|
|
74
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
75
|
+
fs.writeFileSync(file, JSON.stringify({ lastPollAt: new Date().toISOString() }, null, 2) + '\n');
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Steering is best-effort; cache failures should not disturb the turn.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function renderReferences(refs) {
|
|
82
|
+
if (!refs || typeof refs !== 'object')
|
|
83
|
+
return null;
|
|
84
|
+
try {
|
|
85
|
+
const json = JSON.stringify(refs);
|
|
86
|
+
if (!json || json === '{}')
|
|
87
|
+
return null;
|
|
88
|
+
return json.length > 500 ? json.slice(0, 500) + '...' : json;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function formatSender(message) {
|
|
95
|
+
const from = message.from || {};
|
|
96
|
+
const handle = from.handle || from.tenant || 'unknown sender';
|
|
97
|
+
const short = (0, session_id_1.truncateSessionId)(from.session_id || undefined);
|
|
98
|
+
return short ? `${handle}/${short}` : handle;
|
|
99
|
+
}
|
|
100
|
+
function formatReplyHint(message) {
|
|
101
|
+
const from = message.from || {};
|
|
102
|
+
const handle = from.handle || from.tenant;
|
|
103
|
+
const short = (0, session_id_1.truncateSessionId)(from.session_id || undefined);
|
|
104
|
+
if (handle && short)
|
|
105
|
+
return `Reply with: greprag send "..." --to ${handle}/${short}`;
|
|
106
|
+
if (handle)
|
|
107
|
+
return `Reply with: greprag send "..." --to ${handle}`;
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
function formatCodexInboxSteering(messages, session8) {
|
|
111
|
+
const unread = messages.filter(m => m && typeof m.body === 'string' && m.body.trim());
|
|
112
|
+
if (unread.length === 0)
|
|
113
|
+
return null;
|
|
114
|
+
const parts = [
|
|
115
|
+
`[GrepRAG inbox: ${unread.length} unread message(s) delivered to Codex session ${session8}]`,
|
|
116
|
+
`Treat these as live operator/agent messages. Act on them in this turn when relevant.`,
|
|
117
|
+
];
|
|
118
|
+
unread.slice(0, 10).forEach((message, idx) => {
|
|
119
|
+
parts.push('');
|
|
120
|
+
parts.push(`Message ${idx + 1} (${message.id}):`);
|
|
121
|
+
parts.push(`From: ${formatSender(message)}`);
|
|
122
|
+
if (message.created_at)
|
|
123
|
+
parts.push(`At: ${message.created_at}`);
|
|
124
|
+
parts.push(message.body.trim());
|
|
125
|
+
const refs = renderReferences(message.references);
|
|
126
|
+
if (refs)
|
|
127
|
+
parts.push(`References: ${refs}`);
|
|
128
|
+
const reply = formatReplyHint(message);
|
|
129
|
+
if (reply)
|
|
130
|
+
parts.push(reply);
|
|
131
|
+
});
|
|
132
|
+
if (unread.length > 10) {
|
|
133
|
+
parts.push('');
|
|
134
|
+
parts.push(`Additional messages omitted: ${unread.length - 10}. Run greprag inbox --session ${session8} to inspect the rest.`);
|
|
135
|
+
}
|
|
136
|
+
return parts.join('\n');
|
|
137
|
+
}
|
|
138
|
+
async function buildCodexInboxSteering(input, cfg, opts = {}) {
|
|
139
|
+
if (!cfg.enabled || !cfg.apiKey)
|
|
140
|
+
return null;
|
|
141
|
+
const cwd = input.cwd || process.cwd();
|
|
142
|
+
const anchor = (0, project_anchor_1.readAnchor)(cwd);
|
|
143
|
+
if (!anchor.projectId)
|
|
144
|
+
return null;
|
|
145
|
+
const session8 = (0, session_id_1.truncateSessionId)(input.session_id);
|
|
146
|
+
if (!session8)
|
|
147
|
+
return null;
|
|
148
|
+
if (opts.debounce && wasRecentlyPolled(input.session_id || session8))
|
|
149
|
+
return null;
|
|
150
|
+
if (opts.debounce)
|
|
151
|
+
stampPoll(input.session_id || session8);
|
|
152
|
+
const url = new URL(`${cfg.apiUrl.replace(/\/+$/, '')}/v1/inbox`);
|
|
153
|
+
url.searchParams.set('project_id', anchor.projectId);
|
|
154
|
+
url.searchParams.set('session_id', session8);
|
|
155
|
+
try {
|
|
156
|
+
const res = await fetch(url, {
|
|
157
|
+
headers: { 'Authorization': `Bearer ${cfg.apiKey}` },
|
|
158
|
+
});
|
|
159
|
+
if (!res.ok)
|
|
160
|
+
return null;
|
|
161
|
+
const data = await res.json();
|
|
162
|
+
return formatCodexInboxSteering(data.messages || [], session8);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=codex-steering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-steering.js","sourceRoot":"","sources":["../src/codex-steering.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGA,4DA2BC;AAED,0DA+BC;AA7JD,uCAAyB;AACzB,2CAA6B;AAC7B,qDAA8C;AAC9C,6CAAiD;AA6BjD,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAEvC,SAAS,QAAQ;IACf,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;IAC/D,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,EAAE,CAAC;IACvB,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;AAC9C,CAA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,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE7C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,OAAO,EAAE,EAAE,eAAe,EAAE,UAAU,GAAG,CAAC,MAAM,EAAE,EAAE;SACrD,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACzB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAmC,CAAC;QAC/D,OAAO,wBAAwB,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Codex live push sidecar.
|
|
2
|
+
*
|
|
3
|
+
* Codex lifecycle hooks only fire while Codex is active. This command supplies
|
|
4
|
+
* the missing live receiver: it subscribes to the GrepRAG inbox stream for a
|
|
5
|
+
* Codex session and wakes that session with `codex exec resume`.
|
|
6
|
+
*/
|
|
7
|
+
interface InboxMessage {
|
|
8
|
+
id: string;
|
|
9
|
+
body: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
to_session_id?: string | null;
|
|
12
|
+
from?: {
|
|
13
|
+
handle?: string | null;
|
|
14
|
+
tenant?: string | null;
|
|
15
|
+
email?: string | null;
|
|
16
|
+
project_id?: string | null;
|
|
17
|
+
session_id?: string | null;
|
|
18
|
+
};
|
|
19
|
+
references?: unknown;
|
|
20
|
+
message_type?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function currentCodexSessionId(): string | null;
|
|
23
|
+
export declare function resolveCodexSessionId(input?: string): string | null;
|
|
24
|
+
export declare function buildLivePushPrompt(msg: InboxMessage, session8: string): string;
|
|
25
|
+
export declare function codexStartupInfo(): {
|
|
26
|
+
kind: string;
|
|
27
|
+
path: string;
|
|
28
|
+
installed: boolean;
|
|
29
|
+
hint: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function installCodexStartup(): void;
|
|
32
|
+
export declare function removeCodexStartup(): void;
|
|
33
|
+
export declare function runCodex(args: string[]): Promise<void>;
|
|
34
|
+
export {};
|