gipity 1.1.10 → 1.1.12
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 +3 -3
- package/dist/agents/index.js +2 -0
- package/dist/agents/opencode.js +143 -0
- package/dist/capture/sources/opencode.js +142 -0
- package/dist/commands/agent.js +38 -3
- package/dist/commands/approval.js +3 -3
- package/dist/commands/build.js +8 -0
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/email.js +2 -2
- package/dist/commands/generate.js +111 -36
- package/dist/commands/key.js +2 -2
- package/dist/commands/logs.js +2 -2
- package/dist/commands/realtime.js +3 -3
- package/dist/commands/records.js +4 -4
- package/dist/commands/service.js +8 -4
- package/dist/index.js +962 -439
- package/dist/knowledge.js +2 -2
- package/dist/opencode-setup.js +171 -0
- package/dist/provider-docs.js +68 -6
- package/dist/relay/setup.js +10 -1
- package/dist/setup.js +31 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ irm https://gipity.ai/install.ps1 | iex
|
|
|
23
23
|
| You want to... | Run |
|
|
24
24
|
|----------------|-----|
|
|
25
25
|
| Start building right now, from anywhere | `gipity build` |
|
|
26
|
-
| Use your own workflow in your own directory | `gipity init`, then `claude` / `codex` / `grok` |
|
|
26
|
+
| Use your own workflow in your own directory | `gipity init`, then `claude` / `codex` / `grok` / `opencode` |
|
|
27
27
|
| Drive this computer from gipity.ai (phone, browser) | `gipity connect` |
|
|
28
28
|
|
|
29
29
|
### `gipity build` - start from anywhere
|
|
@@ -40,7 +40,7 @@ Prefer launching your agent yourself? From any project directory:
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
gipity init
|
|
43
|
-
claude # or codex, or
|
|
43
|
+
claude # or codex, grok, or opencode - whatever you use
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
`init` links the directory to a Gipity project, writes CLAUDE.md/AGENTS.md primers so your agent understands Gipity, and installs the Gipity skills + file-sync hooks into the agent CLIs found on your machine (Claude Code, Codex, Grok; Cursor and Gemini get primer files too).
|
|
@@ -126,7 +126,7 @@ gipity login --email you@example.com
|
|
|
126
126
|
gipity login --code 123456
|
|
127
127
|
cd my-project
|
|
128
128
|
gipity init
|
|
129
|
-
claude # or codex, or
|
|
129
|
+
claude # or codex, grok, or opencode
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
## Coding Agent Integration
|
package/dist/agents/index.js
CHANGED
|
@@ -2,12 +2,14 @@ import { claudeCodeAdapter } from './claude-code.js';
|
|
|
2
2
|
import { codexAdapter } from './codex.js';
|
|
3
3
|
import { grokAdapter } from './grok.js';
|
|
4
4
|
import { agyAdapter } from './agy.js';
|
|
5
|
+
import { opencodeAdapter } from './opencode.js';
|
|
5
6
|
/** Picker/help order: Claude first (the default), then the others. */
|
|
6
7
|
export const AGENT_ADAPTERS = [
|
|
7
8
|
claudeCodeAdapter,
|
|
8
9
|
codexAdapter,
|
|
9
10
|
grokAdapter,
|
|
10
11
|
agyAdapter,
|
|
12
|
+
opencodeAdapter,
|
|
11
13
|
];
|
|
12
14
|
export const AGENT_KEYS = AGENT_ADAPTERS.map(a => a.key);
|
|
13
15
|
export function getAdapter(key) {
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode adapter (opencode.ai, Anomaly - vanilla opencode, never a fork).
|
|
3
|
+
* Flag surface per the opencode 1.18.x CLI docs: `opencode run [message..]`
|
|
4
|
+
* for headless one-shots with `--model provider/model`, `--session <id>` to
|
|
5
|
+
* continue, `--auto` to auto-approve permissions, `--format json`.
|
|
6
|
+
*
|
|
7
|
+
* Models: the Gipity opencode plugin registers a "gipity" provider - the
|
|
8
|
+
* curated open coding models (DeepSeek / Qwen / Kimi / GLM families) billed
|
|
9
|
+
* via the user's Gipity credits through the platform's serving path. A
|
|
10
|
+
* `--model` value with no provider prefix (a Gipity id or family alias like
|
|
11
|
+
* `deepseek`) is therefore namespaced to `gipity/…` here; opencode-native
|
|
12
|
+
* refs (`anthropic/…`, `openrouter/…`) pass through for BYO-key users.
|
|
13
|
+
*
|
|
14
|
+
* Capture: opencode fires no Claude-format hooks, but it loads plugins in
|
|
15
|
+
* every mode (TUI, `run`, serve). The Gipity plugin mirrors sessions itself -
|
|
16
|
+
* on session.idle it writes a normalized transcript to
|
|
17
|
+
* ~/.gipity/opencode/transcripts/<session_id>.jsonl and invokes the capture
|
|
18
|
+
* runner (`capture.cjs opencode stop`), riding the same ingest spine as every
|
|
19
|
+
* other agent. No launcher-driven replay hack needed (that path exists for
|
|
20
|
+
* Grok because grok -p fires nothing; opencode's plugin bus fires everywhere).
|
|
21
|
+
*/
|
|
22
|
+
import { homedir } from 'os';
|
|
23
|
+
import { join } from 'path';
|
|
24
|
+
import { hasEnvPrefix } from './types.js';
|
|
25
|
+
import { planForInstall, whichFirst } from './self-update.js';
|
|
26
|
+
import { parseTranscript as parseOpencodeTranscript } from '../capture/sources/opencode.js';
|
|
27
|
+
import { OPENCODE_PACKAGE, ensureOpencodeInstalled, ensureOpencodePluginInstalled, ensureOpencodeModelToken, opencodePluginState, removeOpencodePlugin, } from '../opencode-setup.js';
|
|
28
|
+
import { ensureOpencodeSkillsInstalled, removeAgentSkills } from '../setup.js';
|
|
29
|
+
/** opencode's own built-in provider namespaces. A --model whose first segment
|
|
30
|
+
* is one of these is an opencode-native ref (BYO key) and passes through;
|
|
31
|
+
* anything else is treated as a Gipity model id/alias and namespaced to the
|
|
32
|
+
* plugin's "gipity" provider. */
|
|
33
|
+
const OPENCODE_NATIVE_PROVIDERS = new Set([
|
|
34
|
+
'gipity', 'anthropic', 'openai', 'google', 'openrouter', 'xai', 'groq',
|
|
35
|
+
'mistral', 'azure', 'amazon-bedrock', 'github-copilot', 'opencode',
|
|
36
|
+
]);
|
|
37
|
+
function toOpencodeModel(model) {
|
|
38
|
+
const head = model.split('/', 1)[0];
|
|
39
|
+
return OPENCODE_NATIVE_PROVIDERS.has(head) ? model : `gipity/${model}`;
|
|
40
|
+
}
|
|
41
|
+
export const opencodeAdapter = {
|
|
42
|
+
key: 'opencode',
|
|
43
|
+
source: 'opencode',
|
|
44
|
+
harness: 'opencode',
|
|
45
|
+
displayName: 'opencode',
|
|
46
|
+
providerName: 'Anomaly',
|
|
47
|
+
binary: 'opencode',
|
|
48
|
+
buildInteractiveArgs({ resume, model }) {
|
|
49
|
+
const args = [];
|
|
50
|
+
if (model)
|
|
51
|
+
args.push('--model', toOpencodeModel(model));
|
|
52
|
+
if (resume)
|
|
53
|
+
args.push('--session', resume);
|
|
54
|
+
return args;
|
|
55
|
+
},
|
|
56
|
+
buildHeadlessArgs({ message, resume, model, bypassApprovals, jsonStream }) {
|
|
57
|
+
const args = ['run', message];
|
|
58
|
+
if (model)
|
|
59
|
+
args.push('--model', toOpencodeModel(model));
|
|
60
|
+
if (resume)
|
|
61
|
+
args.push('--session', resume);
|
|
62
|
+
if (bypassApprovals)
|
|
63
|
+
args.push('--auto');
|
|
64
|
+
if (jsonStream)
|
|
65
|
+
args.push('--format', 'json');
|
|
66
|
+
return args;
|
|
67
|
+
},
|
|
68
|
+
sessionIdFromStreamEvent(event) {
|
|
69
|
+
// `opencode run --format json` emits bus events; session ids ride
|
|
70
|
+
// properties.sessionID (message/part events) or properties.info.id
|
|
71
|
+
// (session.created/updated).
|
|
72
|
+
const fromProps = event?.properties?.sessionID;
|
|
73
|
+
if (typeof fromProps === 'string' && fromProps)
|
|
74
|
+
return fromProps;
|
|
75
|
+
const fromInfo = event?.properties?.info?.id;
|
|
76
|
+
if (typeof fromInfo === 'string' && fromInfo.startsWith('ses'))
|
|
77
|
+
return fromInfo;
|
|
78
|
+
return null;
|
|
79
|
+
},
|
|
80
|
+
hooksSupportedOnPlatform() {
|
|
81
|
+
return true; // plugin-based capture; no OS-specific hook files
|
|
82
|
+
},
|
|
83
|
+
daemonStreamCapture: false,
|
|
84
|
+
ensureInstalled() {
|
|
85
|
+
return ensureOpencodeInstalled();
|
|
86
|
+
},
|
|
87
|
+
// Plain literal, not `npm install -g ${OPENCODE_PACKAGE}`: this module sits
|
|
88
|
+
// in an import cycle (opencode.ts -> opencode-setup.ts -> setup.ts -> ...
|
|
89
|
+
// -> agents/index.ts -> opencode.ts), so a module-eval read of an imported
|
|
90
|
+
// binding hits the TDZ when the cycle is entered from setup.ts's side.
|
|
91
|
+
// Function bodies (updatePlan below) read the live binding safely.
|
|
92
|
+
installHint: 'npm install -g opencode-ai (or: curl -fsSL https://opencode.ai/install | bash)',
|
|
93
|
+
updatePlan() {
|
|
94
|
+
// Same-channel rule: npm-global installs update via npm; anything else
|
|
95
|
+
// (the curl installer) gets opencode's own `opencode upgrade`.
|
|
96
|
+
return planForInstall(whichFirst('opencode'), OPENCODE_PACKAGE, ['opencode', 'upgrade']);
|
|
97
|
+
},
|
|
98
|
+
async prepareLaunch() {
|
|
99
|
+
// The model slot needs a long-lived token before opencode starts (the
|
|
100
|
+
// plugin reads it at provider-auth time). Mint/refresh is a no-op when
|
|
101
|
+
// one is already valid.
|
|
102
|
+
await ensureOpencodeModelToken();
|
|
103
|
+
},
|
|
104
|
+
detectEnv() {
|
|
105
|
+
// The Gipity plugin injects OPENCODE_SESSION_ID into every shell opencode
|
|
106
|
+
// spawns (shell.env hook); opencode itself may leak other OPENCODE_* vars.
|
|
107
|
+
if (!hasEnvPrefix('OPENCODE'))
|
|
108
|
+
return null;
|
|
109
|
+
return { harness: 'opencode', harnessSession: process.env.OPENCODE_SESSION_ID };
|
|
110
|
+
},
|
|
111
|
+
capture: {
|
|
112
|
+
hookKey: 'opencode',
|
|
113
|
+
parse: (content, afterUuid) => parseOpencodeTranscript(content, afterUuid),
|
|
114
|
+
// The plugin writes the transcript at a derivable path, so a hook payload
|
|
115
|
+
// without transcript_path still resolves.
|
|
116
|
+
resolveTranscriptPath: (hook) => {
|
|
117
|
+
if (!hook.session_id)
|
|
118
|
+
return null;
|
|
119
|
+
const gipityDir = process.env.GIPITY_DIR || join(homedir(), '.gipity');
|
|
120
|
+
return join(gipityDir, 'opencode', 'transcripts', `${hook.session_id}.jsonl`);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
setup: {
|
|
124
|
+
state: () => opencodePluginState(),
|
|
125
|
+
install: () => {
|
|
126
|
+
ensureOpencodeSkillsInstalled();
|
|
127
|
+
ensureOpencodePluginInstalled();
|
|
128
|
+
},
|
|
129
|
+
uninstall: () => {
|
|
130
|
+
const removedPlugin = removeOpencodePlugin();
|
|
131
|
+
const n = removeAgentSkills();
|
|
132
|
+
if (!removedPlugin && !n)
|
|
133
|
+
return null;
|
|
134
|
+
const parts = [];
|
|
135
|
+
if (removedPlugin)
|
|
136
|
+
parts.push('Gipity plugin removed from opencode.');
|
|
137
|
+
if (n)
|
|
138
|
+
parts.push(`Removed ${n} Gipity skills from ~/.agents/skills.`);
|
|
139
|
+
return parts.join(' ');
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode transcript JSONL → ingest entries.
|
|
3
|
+
*
|
|
4
|
+
* opencode does not write a single transcript file itself - it persists
|
|
5
|
+
* sessions as per-message JSON blobs in its own storage dir. The Gipity
|
|
6
|
+
* opencode plugin (installed to ~/.config/opencode/plugins/gipity.js by
|
|
7
|
+
* `gipity` setup, shipped in the GipityAI/skills repo) bridges that gap: on
|
|
8
|
+
* every `session.idle` it fetches the full message list over the opencode
|
|
9
|
+
* server SDK and rewrites
|
|
10
|
+
* ~/.gipity/opencode/transcripts/<session_id>.jsonl
|
|
11
|
+
* with one line per message, then invokes the capture runner (`capture.cjs
|
|
12
|
+
* opencode stop`). Line shape (SDK types, opencode 1.18.x):
|
|
13
|
+
*
|
|
14
|
+
* { info: UserMessage | AssistantMessage, parts: Part[] }
|
|
15
|
+
*
|
|
16
|
+
* info.role 'user' → prompt entry (joined text parts; synthetic parts
|
|
17
|
+
* are plugin/system injections and are skipped)
|
|
18
|
+
* info.role 'assistant' → assistant entry (text, tokens, modelID, finish)
|
|
19
|
+
* + tool_use per tool part (stable `callID`)
|
|
20
|
+
* + tool_result per completed/errored tool part
|
|
21
|
+
* reasoning / step-start / step-finish / file / snapshot parts → SKIP
|
|
22
|
+
*
|
|
23
|
+
* Dedup/watermark: message ids (`msg_…`) are stable and ordered, so the
|
|
24
|
+
* watermark is the last message id emitted. The file is fully rewritten each
|
|
25
|
+
* idle; a watermark that no longer appears (deleted/forked session) makes the
|
|
26
|
+
* caller replay from the top, and the server's source_uuid unique index
|
|
27
|
+
* collapses anything already forwarded. tool_use/tool_result key off the
|
|
28
|
+
* stable `callID`, which survives rewrites.
|
|
29
|
+
*/
|
|
30
|
+
function toIso(ms) {
|
|
31
|
+
return typeof ms === 'number' && ms > 0 ? new Date(ms).toISOString() : undefined;
|
|
32
|
+
}
|
|
33
|
+
function joinTextParts(parts) {
|
|
34
|
+
const out = [];
|
|
35
|
+
for (const p of parts) {
|
|
36
|
+
if (p?.type === 'text' && typeof p.text === 'string' && !p.synthetic && !p.ignored) {
|
|
37
|
+
out.push(p.text);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return out.join('\n');
|
|
41
|
+
}
|
|
42
|
+
function messageToEntries(info, parts) {
|
|
43
|
+
if (!info || typeof info.id !== 'string')
|
|
44
|
+
return [];
|
|
45
|
+
const ts = toIso(info?.time?.created);
|
|
46
|
+
if (info.role === 'user') {
|
|
47
|
+
const prompt = joinTextParts(parts);
|
|
48
|
+
if (!prompt)
|
|
49
|
+
return [];
|
|
50
|
+
return [{ kind: 'prompt', prompt, source_uuid: info.id, ...(ts ? { ts } : {}) }];
|
|
51
|
+
}
|
|
52
|
+
if (info.role === 'assistant') {
|
|
53
|
+
const out = [];
|
|
54
|
+
const text = joinTextParts(parts);
|
|
55
|
+
const toolParts = parts.filter((p) => p?.type === 'tool' && typeof p.callID === 'string' && p.callID);
|
|
56
|
+
if (text || toolParts.length) {
|
|
57
|
+
out.push({
|
|
58
|
+
kind: 'assistant',
|
|
59
|
+
text,
|
|
60
|
+
blocks: text ? [{ type: 'text', text }] : [],
|
|
61
|
+
...(typeof info?.tokens?.input === 'number' ? { input_tokens: info.tokens.input } : {}),
|
|
62
|
+
...(typeof info?.tokens?.output === 'number' ? { output_tokens: info.tokens.output } : {}),
|
|
63
|
+
...(typeof info.modelID === 'string' ? { model: info.modelID } : {}),
|
|
64
|
+
...(typeof info.finish === 'string' ? { stop_reason: info.finish } : {}),
|
|
65
|
+
source_uuid: info.id,
|
|
66
|
+
...(ts ? { ts } : {}),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
for (const p of toolParts) {
|
|
70
|
+
const toolName = typeof p.tool === 'string' && p.tool ? p.tool : 'tool';
|
|
71
|
+
out.push({
|
|
72
|
+
kind: 'tool_use',
|
|
73
|
+
tool_use_id: p.callID,
|
|
74
|
+
tool_name: toolName,
|
|
75
|
+
tool_input: p?.state?.input ?? null,
|
|
76
|
+
source_uuid: p.callID,
|
|
77
|
+
});
|
|
78
|
+
const status = p?.state?.status;
|
|
79
|
+
if (status === 'completed' || status === 'error') {
|
|
80
|
+
out.push({
|
|
81
|
+
kind: 'tool_result',
|
|
82
|
+
tool_use_id: p.callID,
|
|
83
|
+
tool_name: toolName,
|
|
84
|
+
content: status === 'error' ? (p.state.error ?? '') : (p.state.output ?? ''),
|
|
85
|
+
...(status === 'error' ? { is_error: true } : {}),
|
|
86
|
+
source_uuid: `${p.callID}#out`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
/** Parse the plugin-written transcript JSONL and emit every ingest entry that
|
|
95
|
+
* comes *after* the message-id watermark `afterUuid`. Same contract as the
|
|
96
|
+
* claude-code parser. */
|
|
97
|
+
export function parseTranscript(content, afterUuid) {
|
|
98
|
+
const lines = content.split('\n');
|
|
99
|
+
// First pass: locate the watermark message so a rewind/fork (id gone)
|
|
100
|
+
// replays from the top instead of wedging capture.
|
|
101
|
+
let watermarkLine = -1;
|
|
102
|
+
if (afterUuid) {
|
|
103
|
+
for (let i = 0; i < lines.length; i++) {
|
|
104
|
+
const line = lines[i].trim();
|
|
105
|
+
if (!line)
|
|
106
|
+
continue;
|
|
107
|
+
try {
|
|
108
|
+
if (JSON.parse(line)?.info?.id === afterUuid) {
|
|
109
|
+
watermarkLine = i;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch { /* skip unparseable */ }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const foundWatermark = afterUuid === null || watermarkLine !== -1;
|
|
117
|
+
const out = [];
|
|
118
|
+
let lastUuid = foundWatermark ? afterUuid : null;
|
|
119
|
+
for (let i = 0; i < lines.length; i++) {
|
|
120
|
+
if (watermarkLine !== -1 && i <= watermarkLine)
|
|
121
|
+
continue;
|
|
122
|
+
const line = lines[i].trim();
|
|
123
|
+
if (!line)
|
|
124
|
+
continue;
|
|
125
|
+
let parsed;
|
|
126
|
+
try {
|
|
127
|
+
parsed = JSON.parse(line);
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const entries = messageToEntries(parsed?.info, Array.isArray(parsed?.parts) ? parsed.parts : []);
|
|
133
|
+
if (!entries.length)
|
|
134
|
+
continue;
|
|
135
|
+
for (const e of entries)
|
|
136
|
+
out.push(e);
|
|
137
|
+
if (typeof parsed?.info?.id === 'string')
|
|
138
|
+
lastUuid = parsed.info.id;
|
|
139
|
+
}
|
|
140
|
+
return { entries: out, lastUuid, foundWatermark };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=opencode.js.map
|
package/dist/commands/agent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { get, post, put, del } from '../api.js';
|
|
3
3
|
import { requireConfig, saveConfig } from '../config.js';
|
|
4
|
-
import { error as clrError, success } from '../colors.js';
|
|
4
|
+
import { error as clrError, success, muted } from '../colors.js';
|
|
5
5
|
import { run, printList, printResult } from '../helpers/index.js';
|
|
6
6
|
import { confirm } from '../utils.js';
|
|
7
7
|
export const agentCommand = new Command('agent')
|
|
@@ -32,10 +32,45 @@ export const agentCommand = new Command('agent')
|
|
|
32
32
|
return `${a.name}${active}${def}${model}`;
|
|
33
33
|
});
|
|
34
34
|
}));
|
|
35
|
+
agentCommand
|
|
36
|
+
.command('models')
|
|
37
|
+
.description('List the LLM models an agent can use (ids and tier aliases for `agent create --model` and `agent set model`)')
|
|
38
|
+
.option('--json', 'Output as JSON')
|
|
39
|
+
.action((opts) => run('Models', async () => {
|
|
40
|
+
const res = await get('/agents/models');
|
|
41
|
+
if (opts.json) {
|
|
42
|
+
console.log(JSON.stringify({ models: res.data, aliases: res.aliases ?? {} }));
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const width = res.data.reduce((m, x) => Math.max(m, x.id.length), 0);
|
|
46
|
+
for (const m of res.data) {
|
|
47
|
+
const notes = [
|
|
48
|
+
m.displayName,
|
|
49
|
+
m.provider,
|
|
50
|
+
`$${m.inputCostPerMTok}/$${m.outputCostPerMTok} per 1M tok`,
|
|
51
|
+
`${Math.round(m.maxContextTokens / 1000)}K ctx`,
|
|
52
|
+
];
|
|
53
|
+
if (m.blurb)
|
|
54
|
+
notes.push(m.blurb);
|
|
55
|
+
if (m.isDefault)
|
|
56
|
+
notes.push('default');
|
|
57
|
+
console.log(`${m.id.padEnd(width)} ${muted(notes.join(' · '))}`);
|
|
58
|
+
}
|
|
59
|
+
// Tier aliases (older servers don't send them): an id pins that exact
|
|
60
|
+
// model; an alias follows the platform's rotation as new models ship.
|
|
61
|
+
if (res.aliases && Object.keys(res.aliases).length > 0) {
|
|
62
|
+
console.log('');
|
|
63
|
+
console.log('Tier aliases (an agent set to one follows the platform model rotations):');
|
|
64
|
+
const aw = Object.keys(res.aliases).reduce((m, k) => Math.max(m, k.length), 0);
|
|
65
|
+
for (const [alias, id] of Object.entries(res.aliases)) {
|
|
66
|
+
console.log(`${alias.padEnd(aw)} ${muted(`-> ${id}`)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
35
70
|
agentCommand
|
|
36
71
|
.command('create <name>')
|
|
37
72
|
.description('Create an agent')
|
|
38
|
-
.option('--model <model>', 'Model
|
|
73
|
+
.option('--model <model>', 'Model id (pins that model) or tier alias like gipity-default/opus (follows rotations) - see `gipity agent models`. Default: gipity-default')
|
|
39
74
|
.option('--switch', 'Switch to new agent after creation')
|
|
40
75
|
.option('--json', 'Output as JSON')
|
|
41
76
|
.action((name, opts) => run('Create', async () => {
|
|
@@ -58,7 +93,7 @@ agentCommand
|
|
|
58
93
|
}));
|
|
59
94
|
agentCommand
|
|
60
95
|
.command('set <field> <value>')
|
|
61
|
-
.description('Set a field (model, temp)')
|
|
96
|
+
.description('Set a field (model, temp). Model ids + tier aliases: `gipity agent models`')
|
|
62
97
|
.option('--json', 'Output as JSON')
|
|
63
98
|
.action((field, value, opts) => run('Set', async () => {
|
|
64
99
|
const config = requireConfig();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post } from '../api.js';
|
|
3
3
|
import { muted, success } from '../colors.js';
|
|
4
4
|
import { run, printList, printResult } from '../helpers/index.js';
|
|
@@ -25,7 +25,7 @@ export const approvalCommand = new Command('approval')
|
|
|
25
25
|
approvalCommand
|
|
26
26
|
.command('list')
|
|
27
27
|
.description('List pending approvals')
|
|
28
|
-
.
|
|
28
|
+
.addOption(new Option('--status <status>', 'Filter by status').choices(['pending', 'approved', 'denied', 'cancelled', 'expired', 'all']).default('pending'))
|
|
29
29
|
.option('--json', 'Output as JSON')
|
|
30
30
|
.action((opts) => run('List', async () => {
|
|
31
31
|
const res = await get(`/approvals?status=${encodeURIComponent(opts.status)}`);
|
|
@@ -35,7 +35,7 @@ approvalCommand
|
|
|
35
35
|
.command('create <title...>')
|
|
36
36
|
.description('Create a pending approval')
|
|
37
37
|
.option('--description <text>', 'Detailed context')
|
|
38
|
-
.
|
|
38
|
+
.addOption(new Option('--type <type>', 'Approval type').choices(['yes_no', 'choice', 'text']).default('yes_no'))
|
|
39
39
|
.option('--choices <a,b,c>', 'Comma-separated options (for --type choice)')
|
|
40
40
|
.option('--prompt <text>', 'Custom prompt shown to the user')
|
|
41
41
|
.option('--expires-in <minutes>', 'Minutes until expiry (default: 10080 = 7d)')
|
package/dist/commands/build.js
CHANGED
|
@@ -1127,6 +1127,14 @@ async function launchNonClaudeAgent(adapter, ctx) {
|
|
|
1127
1127
|
console.log('');
|
|
1128
1128
|
}
|
|
1129
1129
|
// ── Spawn ───────────────────────────────────────────────────────────────
|
|
1130
|
+
// Async pre-spawn setup (e.g. opencode's model-slot token mint). Best-effort:
|
|
1131
|
+
// the agent must still launch when offline or logged out.
|
|
1132
|
+
if (adapter.prepareLaunch) {
|
|
1133
|
+
try {
|
|
1134
|
+
await adapter.prepareLaunch();
|
|
1135
|
+
}
|
|
1136
|
+
catch { /* never block the launch */ }
|
|
1137
|
+
}
|
|
1130
1138
|
const childEnv = { ...process.env };
|
|
1131
1139
|
if (convGuid)
|
|
1132
1140
|
childEnv.GIPITY_CONVERSATION_GUID = convGuid;
|
package/dist/commands/deploy.js
CHANGED
|
@@ -21,7 +21,7 @@ export const deployCommand = new Command('deploy')
|
|
|
21
21
|
.description('Deploy to dev or prod')
|
|
22
22
|
.argument('[target]', 'dev or prod', 'dev')
|
|
23
23
|
.option('--source-dir <dir>', 'Source directory to deploy from')
|
|
24
|
-
.option('--only <phases>', 'Run only specific phases
|
|
24
|
+
.option('--only <phases>', 'Run only specific phases, comma-separated, matched by gipity.yaml phase name or type: files/static, database/sql, functions, workflows, services, jobs, records, realtime, env, auth_branding')
|
|
25
25
|
.option('--force', 'Re-run all phases (ignore checksums) and bypass the sync bulk-deletion guard')
|
|
26
26
|
.option('--no-sync', 'Skip sync-up before deploy')
|
|
27
27
|
.option('--optimize', 'Force Vite build optimization on (default for prod; use this to optimize a dev deploy too)')
|
package/dist/commands/email.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post } from '../api.js';
|
|
3
3
|
import { resolveProjectContext } from '../config.js';
|
|
4
4
|
import { error as clrError, success, bold, muted, warning } from '../colors.js';
|
|
@@ -98,7 +98,7 @@ emailCommand
|
|
|
98
98
|
emailCommand
|
|
99
99
|
.command('log')
|
|
100
100
|
.description('Recent email() sends and skipped attempts from your app')
|
|
101
|
-
.
|
|
101
|
+
.addOption(new Option('--range <range>', 'Time range').choices(['1h', '24h', '7d', '30d', '1y']).default('7d'))
|
|
102
102
|
.option('--limit <n>', 'Max rows', '50')
|
|
103
103
|
.option('--project <guid-or-slug>', 'Target a specific project instead of cwd / Home')
|
|
104
104
|
.option('--json', 'Output raw JSON')
|