gipity 1.1.11 → 1.1.13
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/adopt-cwd.js +5 -6
- package/dist/agents/index.js +2 -0
- package/dist/agents/opencode.js +143 -0
- package/dist/api.js +14 -5
- package/dist/capture/sources/claude-code.js +23 -0
- package/dist/capture/sources/codex.js +30 -1
- package/dist/capture/sources/opencode.js +156 -0
- package/dist/commands/agent.js +14 -4
- package/dist/commands/build.js +13 -5
- package/dist/commands/generate.js +23 -8
- package/dist/commands/service.js +7 -2
- package/dist/hooks/capture-runner.js +94 -4
- package/dist/index.js +983 -552
- package/dist/knowledge.js +2 -2
- package/dist/opencode-setup.js +178 -0
- package/dist/provider-docs.js +6 -8
- package/dist/relay/setup.js +10 -1
- package/dist/setup.js +38 -1
- package/package.json +2 -2
package/dist/knowledge.js
CHANGED
|
@@ -52,7 +52,7 @@ Prefer the cheapest option that works - CLI and sandbox are instant and free, ap
|
|
|
52
52
|
3. App services - runtime HTTP endpoints your deployed app calls directly at \`https://a.gipity.ai/api/<PROJECT_GUID>/services/*\`. Available: LLM, TTS, image, sound, music, transcribe, video, file upload, realtime, location, push notifications (Gipity Notify - \`gipity add notify\`, send from a function with the injected \`notify()\`; see \`app-notify\`). Load the matching skill (\`app-llm\`, \`app-tts\`, etc.) before writing service code - they have the schemas, auth pattern, and common-mistake guards. For one-off generation during development, prefer \`gipity generate <image|video|speech|sound|music>\` or \`gipity chat\` - direct generation always bills you (the owner), regardless of any service \`billing_mode\` (that setting only governs the deployed app's runtime calls; never flip it just to create assets). \`gipity generate\` saves to a generic file in the current directory by default (e.g. \`./generated.png\`) - pass \`-o <path>\` to write it straight into your source tree so it deploys (e.g. \`gipity generate image "hero banner" -o src/assets/images/hero.png\`) instead of generating at cwd and moving it.
|
|
53
53
|
4. Delegate to Gip (\`gipity chat "<task>"\`) - only when the work genuinely needs agent reasoning or a tool not in the CLI, sandbox, or app services. Required for: Twitter/X search, Gmail, calendar, push notifications, video understanding, audio source isolation, cross-model second opinions, multi-step orchestration. Don't use \`gipity chat\` for anything the sandbox can do - it's slower and burns tokens.
|
|
54
54
|
|
|
55
|
-
You are the developer. Write files in this directory - Gipity's editor hooks (installed by \`gipity init\` into Claude Code, Grok, and
|
|
55
|
+
You are the developer. Write files in this directory - Gipity's editor hooks (installed by \`gipity init\` into Claude Code, Grok, Codex, and opencode) auto-sync them to Gipity. Don't run \`npm install\`, \`npm start\`, \`node\`, or \`python\` locally; there is no local runtime. Code runs in the Gipity sandbox.
|
|
56
56
|
|
|
57
57
|
## Use first-party services before reaching outside
|
|
58
58
|
|
|
@@ -144,7 +144,7 @@ Every tool call returns its full output with that call. There is no output buffe
|
|
|
144
144
|
|
|
145
145
|
This directory is the app root - it holds \`.gipity.json\` (and \`gipity.yaml\` for backends) and is already your cwd, so run app commands here. Don't \`cd\` to a git root (\`git rev-parse --show-toplevel\`): when the app is nested in a larger repo that resolves outside the app.
|
|
146
146
|
|
|
147
|
-
Write files locally - Gipity's editor hooks (installed into Claude Code, Grok, and
|
|
147
|
+
Write files locally - Gipity's editor hooks (installed into Claude Code, Grok, Codex, and opencode by \`gipity init\`) auto-push every save to Gipity and auto-pull remote changes (images, audio from \`gipity chat\`) before each turn. Use \`gipity sync\` if things get out of sync (or if the hooks aren't installed - \`gipity status --repair-hooks\` re-enables them). Deletes are safe - use \`rollback\` with a datetime to undo, or \`file_version_restore\` for individual files.
|
|
148
148
|
|
|
149
149
|
To keep local-only material (research clones, scratch data, vendored references) in the project directory without syncing or deploying it, list it in a \`.gipityignore\` at the project root - gitignore-style, one pattern per line, \`#\` comments. Ignored paths are invisible to sync in both directions; anything that already synced before being ignored stays on the server until you delete it.
|
|
150
150
|
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* opencode install + integration helpers, shared by `gipity build --agent
|
|
3
|
+
* opencode` (auto-ensures opencode before launching) and the opencode
|
|
4
|
+
* adapter's setup surface.
|
|
5
|
+
*
|
|
6
|
+
* The integration has three legs, all idempotent and best-effort:
|
|
7
|
+
*
|
|
8
|
+
* 1. Skills: opencode reads the cross-agent ~/.agents/skills directory
|
|
9
|
+
* natively (same SKILL.md family Codex/OpenClaw use), so it shares the
|
|
10
|
+
* Codex skills install (setup.ts installSkillsAndHooks).
|
|
11
|
+
* 2. Plugin: the Gipity opencode plugin (auth + session capture + the
|
|
12
|
+
* "gipity" model provider) ships in the GipityAI/skills repo as
|
|
13
|
+
* hooks/scripts/opencode-plugin.mjs, is staged into ~/.gipity/agent-hooks
|
|
14
|
+
* by the skills install, and is copied from there into opencode's global
|
|
15
|
+
* plugin dir (~/.config/opencode/plugins/gipity.js).
|
|
16
|
+
* 3. Model token: a long-lived gip_at_* agent API token minted for the
|
|
17
|
+
* model slot, stored 0600 at ~/.gipity/opencode-token.json. The plugin
|
|
18
|
+
* reads it (env GIPITY_TOKEN wins, e.g. under a relay daemon) and feeds
|
|
19
|
+
* it to the "gipity" provider as the API key, so opencode's model picker
|
|
20
|
+
* can run the curated open models billed via the user's Gipity credits.
|
|
21
|
+
*/
|
|
22
|
+
import { execSync } from 'child_process';
|
|
23
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync, chmodSync } from 'fs';
|
|
24
|
+
import { homedir, hostname } from 'os';
|
|
25
|
+
import { dirname, join } from 'path';
|
|
26
|
+
import { AGENT_HOOKS_DIR } from './setup.js';
|
|
27
|
+
import { post } from './api.js';
|
|
28
|
+
import { getAuth } from './auth.js';
|
|
29
|
+
import { resolveApiBase } from './config.js';
|
|
30
|
+
export const OPENCODE_PACKAGE = 'opencode-ai';
|
|
31
|
+
/** opencode's global config root (its own convention: $XDG_CONFIG_HOME or
|
|
32
|
+
* ~/.config, then /opencode). */
|
|
33
|
+
export function opencodeConfigDir() {
|
|
34
|
+
const base = process.env.XDG_CONFIG_HOME || join(homedir(), '.config');
|
|
35
|
+
return join(base, 'opencode');
|
|
36
|
+
}
|
|
37
|
+
/** Where the Gipity plugin lands inside opencode's global plugin dir. */
|
|
38
|
+
export function opencodePluginDest() {
|
|
39
|
+
return join(opencodeConfigDir(), 'plugins', 'gipity.js');
|
|
40
|
+
}
|
|
41
|
+
/** The staged plugin source (installed by setup.ts installSkillsAndHooks
|
|
42
|
+
* alongside capture.cjs and friends). */
|
|
43
|
+
export function stagedPluginPath() {
|
|
44
|
+
return join(AGENT_HOOKS_DIR, 'opencode-plugin.mjs');
|
|
45
|
+
}
|
|
46
|
+
/** The model-slot token file the plugin reads. Owner-only: it holds a
|
|
47
|
+
* long-lived agent API token. */
|
|
48
|
+
export const OPENCODE_TOKEN_FILE = join(process.env.GIPITY_DIR || join(homedir(), '.gipity'), 'opencode-token.json');
|
|
49
|
+
/** Model tokens self-expire so an orphaned file (user wipes ~/.gipity, we
|
|
50
|
+
* lose the guid to revoke with) doesn't live forever. Launch re-mints on
|
|
51
|
+
* expiry - see ensureOpencodeModelToken(). */
|
|
52
|
+
const MODEL_TOKEN_EXPIRY_DAYS = 90;
|
|
53
|
+
export function isOpencodeInstalled() {
|
|
54
|
+
const cmd = process.platform === 'win32' ? 'where opencode' : 'which opencode';
|
|
55
|
+
try {
|
|
56
|
+
execSync(cmd, { stdio: 'ignore', windowsHide: true });
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Install opencode via npm if it isn't already on PATH. Idempotent, same
|
|
64
|
+
* shape as ensureClaudeInstalled(). Vanilla opencode - never a fork. */
|
|
65
|
+
export function ensureOpencodeInstalled(opts = {}) {
|
|
66
|
+
if (isOpencodeInstalled())
|
|
67
|
+
return true;
|
|
68
|
+
try {
|
|
69
|
+
execSync(`npm install -g ${OPENCODE_PACKAGE}`, {
|
|
70
|
+
stdio: opts.quiet ? 'ignore' : 'inherit',
|
|
71
|
+
windowsHide: true,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
catch { /* fall through to the definitive re-check */ }
|
|
75
|
+
return isOpencodeInstalled();
|
|
76
|
+
}
|
|
77
|
+
/** Copy the staged Gipity plugin into opencode's global plugin dir. Returns
|
|
78
|
+
* true when the plugin is in place after the call. Content-compared so the
|
|
79
|
+
* steady-state cost is two file reads. */
|
|
80
|
+
export function ensureOpencodePluginInstalled() {
|
|
81
|
+
const src = stagedPluginPath();
|
|
82
|
+
if (!existsSync(src)) {
|
|
83
|
+
const installed = existsSync(opencodePluginDest());
|
|
84
|
+
if (!installed) {
|
|
85
|
+
// Never fail silently here: without the plugin, opencode sessions run
|
|
86
|
+
// fine but record nothing, which looks identical to "working".
|
|
87
|
+
console.warn('Gipity opencode plugin is not staged (skills install incomplete?) - session capture is off. Re-run `gipity init` with network access to fix.');
|
|
88
|
+
}
|
|
89
|
+
return installed;
|
|
90
|
+
}
|
|
91
|
+
const dest = opencodePluginDest();
|
|
92
|
+
try {
|
|
93
|
+
if (existsSync(dest) && readFileSync(dest, 'utf-8') === readFileSync(src, 'utf-8'))
|
|
94
|
+
return true;
|
|
95
|
+
mkdirSync(join(opencodeConfigDir(), 'plugins'), { recursive: true });
|
|
96
|
+
copyFileSync(src, dest);
|
|
97
|
+
console.log('Installed the Gipity plugin for opencode (models + session capture).');
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return existsSync(dest);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function opencodePluginState() {
|
|
105
|
+
const src = stagedPluginPath();
|
|
106
|
+
const dest = opencodePluginDest();
|
|
107
|
+
try {
|
|
108
|
+
return { current: existsSync(dest) && (!existsSync(src) || readFileSync(dest, 'utf-8') === readFileSync(src, 'utf-8')) };
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return { current: false };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export function removeOpencodePlugin() {
|
|
115
|
+
const dest = opencodePluginDest();
|
|
116
|
+
if (!existsSync(dest))
|
|
117
|
+
return false;
|
|
118
|
+
try {
|
|
119
|
+
unlinkSync(dest);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
export function readOpencodeModelToken() {
|
|
127
|
+
try {
|
|
128
|
+
const parsed = JSON.parse(readFileSync(OPENCODE_TOKEN_FILE, 'utf-8'));
|
|
129
|
+
return typeof parsed?.token === 'string' && parsed.token ? parsed : null;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Ensure a valid model-slot token exists, minting one when absent or dead.
|
|
137
|
+
* Requires a logged-in session (minting uses normal session auth); silently
|
|
138
|
+
* no-ops when logged out or offline - the plugin then falls back to
|
|
139
|
+
* GIPITY_TOKEN env (the relay/devbox path) or reports auth missing.
|
|
140
|
+
*/
|
|
141
|
+
export async function ensureOpencodeModelToken() {
|
|
142
|
+
const existing = readOpencodeModelToken();
|
|
143
|
+
if (existing) {
|
|
144
|
+
// Only a definitive 401 discards a stored token - a network blip must
|
|
145
|
+
// not trigger a re-mint storm (same rule as relay/agent-token.ts).
|
|
146
|
+
try {
|
|
147
|
+
const res = await fetch(`${resolveApiBase()}/users/me`, {
|
|
148
|
+
headers: { Authorization: `Bearer ${existing.token}` },
|
|
149
|
+
});
|
|
150
|
+
if (res.status !== 401)
|
|
151
|
+
return existing.token;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return existing.token;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (!getAuth())
|
|
158
|
+
return null;
|
|
159
|
+
try {
|
|
160
|
+
const res = await post('/auth/agent-tokens', { name: `opencode models on ${hostname()}`, expiresInDays: MODEL_TOKEN_EXPIRY_DAYS });
|
|
161
|
+
const stored = {
|
|
162
|
+
token: res.data.token,
|
|
163
|
+
guid: res.data.shortGuid,
|
|
164
|
+
mintedAt: new Date().toISOString(),
|
|
165
|
+
};
|
|
166
|
+
mkdirSync(dirname(OPENCODE_TOKEN_FILE), { recursive: true, mode: 0o700 });
|
|
167
|
+
writeFileSync(OPENCODE_TOKEN_FILE, JSON.stringify(stored, null, 2), { mode: 0o600 });
|
|
168
|
+
try {
|
|
169
|
+
chmodSync(OPENCODE_TOKEN_FILE, 0o600);
|
|
170
|
+
}
|
|
171
|
+
catch { /* best-effort */ }
|
|
172
|
+
return stored.token;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=opencode-setup.js.map
|
package/dist/provider-docs.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Source: platform/server/src/config/constants/provider-docs.ts
|
|
6
6
|
* Run `just sync-docs` to refresh from platform.
|
|
7
7
|
*/
|
|
8
|
-
export const GEMINI_LLM_MODELS_DOC = `gemini-3.6-flash (Gemini 3.6 Flash, $1.5/$7.5 per 1M tok, 1049K ctx), gemini-3.5-flash (Gemini 3.5 Flash, $1.5/$9 per 1M tok, 1049K ctx), gemini-3.1-pro-preview (Gemini 3.1 Pro, $2/$12 per 1M tok, 1049K ctx), gemini-3.1-flash-lite (Gemini 3.1 Flash-Lite, $0.25/$1.5 per 1M tok, 1049K ctx), gemini-3-flash-preview (Gemini 3 Flash, $0.5/$3 per 1M tok, 1049K ctx), gemini-2.5-
|
|
8
|
+
export const GEMINI_LLM_MODELS_DOC = `gemini-3.6-flash (Gemini 3.6 Flash, $1.5/$7.5 per 1M tok, 1049K ctx), gemini-3.5-flash (Gemini 3.5 Flash, $1.5/$9 per 1M tok, 1049K ctx), gemini-3.1-pro-preview (Gemini 3.1 Pro, $2/$12 per 1M tok, 1049K ctx), gemini-3.1-flash-lite (Gemini 3.1 Flash-Lite, $0.25/$1.5 per 1M tok, 1049K ctx), gemini-3-flash-preview (Gemini 3 Flash, $0.5/$3 per 1M tok, 1049K ctx), gemini-2.5-flash (Gemini 2.5 Flash, $0.3/$2.5 per 1M tok, 1049K ctx)`;
|
|
9
9
|
export const GEMINI_TTS_VOICES = [
|
|
10
10
|
'Zephyr',
|
|
11
11
|
'Puck',
|
|
@@ -91,8 +91,8 @@ export const IMAGE_TIER_ALIAS_IDS = [
|
|
|
91
91
|
'high',
|
|
92
92
|
'ultra',
|
|
93
93
|
];
|
|
94
|
-
export const LLM_DEFAULT_MODELS_DOC = `OpenAI: gpt-5.4-nano (cheapest), gpt-5.4-mini (cheap reasoning). Anthropic: claude-haiku-4-5 (cheapest). Gemini: gemini-
|
|
95
|
-
export const LLM_PROVIDERS_LIST = `anthropic, openai, gemini`;
|
|
94
|
+
export const LLM_DEFAULT_MODELS_DOC = `OpenAI: gpt-5.4-nano (cheapest), gpt-5.4-mini (cheap reasoning). Anthropic: claude-haiku-4-5 (cheapest). Gemini: gemini-3.1-flash-lite (cheapest, 1M context)`;
|
|
95
|
+
export const LLM_PROVIDERS_LIST = `anthropic, openai, gemini, openrouter`;
|
|
96
96
|
export const OPENAI_TTS_VOICES_DOC = `alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse`;
|
|
97
97
|
export const TRANSCRIBE_PROVIDERS_DOC = `elevenlabs (default, Scribe v2), openai (GPT-4o Transcribe), gemini (Gemini 2.5 Flash - cheapest, multilingual)`;
|
|
98
98
|
export const TTS_PROVIDERS_LIST = `elevenlabs, openai, gemini`;
|
|
@@ -112,17 +112,15 @@ export const VIDEO_ASPECT_RATIO_IDS = [
|
|
|
112
112
|
'9:16',
|
|
113
113
|
'1:1',
|
|
114
114
|
];
|
|
115
|
-
export const VIDEO_MODELS_DOC = `veo-3.1-generate-preview (best quality, up to 4K, ~$0.40/sec), veo-3.1-fast-generate-preview (faster, ~$0.10/sec), veo-3.1-lite-generate-preview (budget, ~$0.05/sec)
|
|
116
|
-
export const VIDEO_MODELS_LIST = `veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.1-lite-generate-preview
|
|
115
|
+
export const VIDEO_MODELS_DOC = `veo-3.1-generate-preview (best quality, up to 4K, ~$0.40/sec), veo-3.1-fast-generate-preview (faster, ~$0.10/sec), veo-3.1-lite-generate-preview (budget, ~$0.05/sec)`;
|
|
116
|
+
export const VIDEO_MODELS_LIST = `veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.1-lite-generate-preview`;
|
|
117
117
|
export const VIDEO_MODELS_TABLE = ` veo-3.1-generate-preview best quality, up to 4K, ~$0.40/sec
|
|
118
118
|
veo-3.1-fast-generate-preview faster, ~$0.10/sec
|
|
119
|
-
veo-3.1-lite-generate-preview budget, ~$0.05/sec
|
|
120
|
-
gemini-omni-flash-preview 3-10s @ 720p, conversational editing, ~$0.10/sec`;
|
|
119
|
+
veo-3.1-lite-generate-preview budget, ~$0.05/sec`;
|
|
121
120
|
export const VIDEO_MODEL_IDS = [
|
|
122
121
|
'veo-3.1-generate-preview',
|
|
123
122
|
'veo-3.1-fast-generate-preview',
|
|
124
123
|
'veo-3.1-lite-generate-preview',
|
|
125
|
-
'gemini-omni-flash-preview',
|
|
126
124
|
];
|
|
127
125
|
export const VIDEO_RESOLUTIONS = `720p, 1080p, 4k`;
|
|
128
126
|
export const VIDEO_RESOLUTION_IDS = [
|
package/dist/relay/setup.js
CHANGED
|
@@ -91,7 +91,16 @@ export async function pairDevice(opts = {}) {
|
|
|
91
91
|
throw new Error('Device name must be 1–100 non-whitespace characters.');
|
|
92
92
|
}
|
|
93
93
|
const plat = mapPlatform(osPlatform());
|
|
94
|
-
|
|
94
|
+
// Platform-provisioned devboxes declare what they run and where they live
|
|
95
|
+
// (the relay-host entrypoint sets these); a normal local pairing sends
|
|
96
|
+
// neither and the server defaults to local/claude_code.
|
|
97
|
+
const deviceKind = process.env.GIPITY_DEVICE_KIND;
|
|
98
|
+
const agentKind = process.env.GIPITY_AGENT_KIND;
|
|
99
|
+
const res = await post('/remote-devices', {
|
|
100
|
+
name, platform: plat, machine_id: getMachineId(),
|
|
101
|
+
...(deviceKind ? { device_kind: deviceKind } : {}),
|
|
102
|
+
...(agentKind ? { agent_kind: agentKind } : {}),
|
|
103
|
+
});
|
|
95
104
|
state.setDevice({
|
|
96
105
|
guid: res.data.short_guid,
|
|
97
106
|
name,
|
package/dist/setup.js
CHANGED
|
@@ -7,6 +7,7 @@ import { existsSync, mkdirSync, writeFileSync, readFileSync, mkdtempSync, rmSync
|
|
|
7
7
|
import { resolveCommand, spawnSyncCommand } from './platform.js';
|
|
8
8
|
import { SKILLS_CONTENT, BUILD_VS_NON_BUILD_RULE, DEFINITION_OF_DONE } from './knowledge.js';
|
|
9
9
|
import { DEFAULT_API_BASE, resolveApiBase } from './config.js';
|
|
10
|
+
import { ensureOpencodePluginInstalled, stagedPluginPath } from './opencode-setup.js';
|
|
10
11
|
export { SKILLS_CONTENT };
|
|
11
12
|
/** Canonical list of workstation artifacts that are NOT part of the project.
|
|
12
13
|
* Used as the single source of truth for three separate decisions:
|
|
@@ -33,6 +34,7 @@ export const PRIMER_FILES = {
|
|
|
33
34
|
codex: 'AGENTS.md',
|
|
34
35
|
grok: 'AGENTS.md', // Grok Build reads the AGENTS.md family (and CLAUDE.md) natively
|
|
35
36
|
agy: 'AGENTS.md', // Antigravity reads the same AGENTS.md/GEMINI.md rules family natively
|
|
37
|
+
opencode: 'AGENTS.md', // opencode reads AGENTS.md (and CLAUDE.md) natively
|
|
36
38
|
aider: 'AGENTS.md', // shares the Codex primer; aider is pointed at it via .aider.conf.yml
|
|
37
39
|
gemini: 'GEMINI.md',
|
|
38
40
|
copilot: '.github/copilot-instructions.md',
|
|
@@ -151,7 +153,7 @@ export const LEGACY_MARKETPLACE_REPO = 'GipityAI/claude-plugin';
|
|
|
151
153
|
// an installed plugin when the marketplace advances - only an explicit
|
|
152
154
|
// `plugin install`/`update` does - so this constant is how a CLI upgrade tells
|
|
153
155
|
// ensureGipityPluginInstalled() to refresh a stale user-scope install.
|
|
154
|
-
export const GIPITY_PLUGIN_VERSION = '0.
|
|
156
|
+
export const GIPITY_PLUGIN_VERSION = '0.8.0';
|
|
155
157
|
/** True for hook commands the CLI itself wrote into settings.json in past
|
|
156
158
|
* versions. Matched by signature so migration strips exactly our own
|
|
157
159
|
* entries and never touches user-authored hooks. */
|
|
@@ -638,6 +640,40 @@ export function setupCodexIntegration() {
|
|
|
638
640
|
ensureAgentSkillsInstalled();
|
|
639
641
|
setupCodexHooks();
|
|
640
642
|
}
|
|
643
|
+
// --- opencode ----------------------------------------------------------------
|
|
644
|
+
// opencode reads the same cross-agent ~/.agents/skills directory Codex does
|
|
645
|
+
// (it walks .agents/skills natively), so its skills install shares the Codex
|
|
646
|
+
// dir + manifest. Its deeper integration - the Gipity plugin providing the
|
|
647
|
+
// model slot and session capture - lives in opencode-setup.ts; the plugin file
|
|
648
|
+
// itself ships in the GipityAI/skills repo (hooks/scripts/opencode-plugin.mjs)
|
|
649
|
+
// and is staged into ~/.gipity/agent-hooks by installSkillsAndHooks like every
|
|
650
|
+
// other hook script.
|
|
651
|
+
/** Materialize the Gipity skills for opencode. Shares AGENTS_SKILLS_DIR (and
|
|
652
|
+
* the manifest) with Codex - both read the same cross-agent directory - but
|
|
653
|
+
* gates on the opencode binary so either tool being present is enough.
|
|
654
|
+
*
|
|
655
|
+
* Also re-installs when the staged opencode plugin is absent even though the
|
|
656
|
+
* manifest says current: a machine whose skills predate the plugin's addition
|
|
657
|
+
* to hooks/scripts otherwise never receives it (the version gate can't see
|
|
658
|
+
* per-file additions - that's exactly how session capture silently shipped
|
|
659
|
+
* disabled on every pre-existing install). */
|
|
660
|
+
export function ensureOpencodeSkillsInstalled() {
|
|
661
|
+
if (agentSkillsState().current && existsSync(stagedPluginPath()))
|
|
662
|
+
return;
|
|
663
|
+
if (!binaryOnPath('opencode'))
|
|
664
|
+
return;
|
|
665
|
+
installSkillsAndHooks(AGENTS_SKILLS_DIR, AGENT_SKILLS_MANIFEST, 'opencode');
|
|
666
|
+
}
|
|
667
|
+
/** Full opencode integration: user-scope skills + the Gipity opencode plugin
|
|
668
|
+
* (model provider + session capture). Gated on the opencode binary. The
|
|
669
|
+
* import cycle with opencode-setup.ts (it reads AGENT_HOOKS_DIR from here)
|
|
670
|
+
* is safe: neither module calls into the other at module-eval time. */
|
|
671
|
+
export function setupOpencodeIntegration() {
|
|
672
|
+
if (!binaryOnPath('opencode'))
|
|
673
|
+
return;
|
|
674
|
+
ensureOpencodeSkillsInstalled();
|
|
675
|
+
ensureOpencodePluginInstalled();
|
|
676
|
+
}
|
|
641
677
|
// --- Google Antigravity (agy) --------------------------------------------
|
|
642
678
|
// agy's hook system is a real departure from the Claude-format hooks Codex
|
|
643
679
|
// and Grok reuse: project hooks live in `.agents/hooks.json` as a NAMED-block
|
|
@@ -1009,6 +1045,7 @@ export const SUPPORTED_TOOLS = [
|
|
|
1009
1045
|
{ key: 'codex', label: 'OpenAI Codex (AGENTS.md + skills + sync hooks)', setup: setupAgentsMd, integrate: setupCodexIntegration },
|
|
1010
1046
|
{ key: 'grok', label: 'Grok Build (AGENTS.md + Gipity plugin)', setup: setupAgentsMd, integrate: ensureGrokPluginInstalled },
|
|
1011
1047
|
{ key: 'agy', label: 'Antigravity (AGENTS.md + skills + sync hooks)', setup: setupAgentsMd, integrate: setupAgyIntegration },
|
|
1048
|
+
{ key: 'opencode', label: 'opencode (AGENTS.md + skills + Gipity plugin)', setup: setupAgentsMd, integrate: setupOpencodeIntegration },
|
|
1012
1049
|
{ key: 'aider', label: 'Aider (AGENTS.md + .aider.conf.yml)', setup: setupAiderMd, optIn: true },
|
|
1013
1050
|
{ key: 'gemini', label: 'Gemini CLI (GEMINI.md)', setup: setupGeminiMd },
|
|
1014
1051
|
{ key: 'copilot', label: 'GitHub Copilot (.github/copilot-instructions.md)', setup: setupCopilotMd },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gipity": "dist/updater/shim.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"prepack": "npm run build",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
16
|
"test": "npm run test:smoke",
|
|
17
|
-
"test:smoke": "npm run build && node --test dist/__tests__/utils.test.js dist/__tests__/template-vars.test.js dist/__tests__/platform.test.js dist/__tests__/colors.test.js dist/__tests__/config.test.js dist/__tests__/sync.test.js dist/__tests__/sync-apply.test.js dist/__tests__/sync-unretrievable.test.js dist/__tests__/sync-clean-check.test.js dist/__tests__/sync-lock.test.js dist/__tests__/auth-lock.test.js dist/__tests__/api-401-retry.test.js dist/__tests__/push-cas.test.js dist/__tests__/upload.test.js dist/__tests__/progress.test.js dist/__tests__/updater.test.js dist/__tests__/cli-smoke.test.js dist/__tests__/claude-noninteractive.test.js dist/__tests__/claude-trust.test.js dist/__tests__/build-picker.test.js dist/__tests__/relay-state.test.js dist/__tests__/relay-daemon.test.js dist/__tests__/session-pool.test.js dist/__tests__/relay-diagnostics.test.js dist/__tests__/relay-agent-updates.test.js dist/__tests__/relay-installers.test.js dist/__tests__/relay-bridge-abort.test.js dist/__tests__/relay-redact.test.js dist/__tests__/relay-machine-id.test.js dist/__tests__/stream-json.test.js dist/__tests__/ingest-queue.test.js dist/__tests__/media-upload.test.js dist/__tests__/stream-delta.test.js dist/__tests__/phase-tracker.test.js dist/__tests__/relay-ingest-contract.test.js dist/__tests__/prompts.test.js dist/__tests__/capture-transcript.test.js dist/__tests__/capture-parsers.test.js dist/__tests__/agents.test.js dist/__tests__/capture-lock.test.js dist/__tests__/capture-resolve.test.js dist/__tests__/flag-aliases.test.js dist/__tests__/client-context.test.js dist/__tests__/adopt-cwd.test.js dist/__tests__/cli-cmd-agent.test.js dist/__tests__/cli-cmd-approval.test.js dist/__tests__/cli-cmd-audit.test.js dist/__tests__/cli-cmd-brand.test.js dist/__tests__/cli-cmd-bug.test.js dist/__tests__/cli-cmd-bug-queue.test.js dist/__tests__/cli-cmd-chat.test.js dist/__tests__/cli-cmd-credits.test.js dist/__tests__/cli-cmd-db.test.js dist/__tests__/cli-cmd-db-checkpoint.test.js dist/__tests__/cli-cmd-deploy.test.js dist/__tests__/cli-cmd-domain.test.js dist/__tests__/cli-cmd-email.test.js dist/__tests__/cli-cmd-file.test.js dist/__tests__/cli-cmd-storage.test.js dist/__tests__/cli-cmd-fn.test.js dist/__tests__/cli-cmd-service.test.js dist/__tests__/cli-cmd-job.test.js dist/__tests__/cli-cmd-generate.test.js dist/__tests__/cli-cmd-gmail.test.js dist/__tests__/cli-cmd-info.test.js dist/__tests__/cli-cmd-init.test.js dist/__tests__/cli-cmd-location.test.js dist/__tests__/cli-cmd-text.test.js dist/__tests__/cli-cmd-login.test.js dist/__tests__/cli-cmd-status.test.js dist/__tests__/cli-cmd-logout.test.js dist/__tests__/cli-cmd-token.test.js dist/__tests__/cli-cmd-key.test.js dist/__tests__/cli-cmd-logs.test.js dist/__tests__/cli-cmd-memory.test.js dist/__tests__/cli-cmd-page.test.js dist/__tests__/cli-cmd-plan.test.js dist/__tests__/cli-cmd-project.test.js dist/__tests__/cli-cmd-rbac.test.js dist/__tests__/cli-cmd-realtime.test.js dist/__tests__/cli-cmd-records.test.js dist/__tests__/cli-cmd-relay.test.js dist/__tests__/cli-cmd-setup.test.js dist/__tests__/cli-cmd-doctor.test.js dist/__tests__/claude-setup.test.js dist/__tests__/cli-cmd-sandbox.test.js dist/__tests__/cli-cmd-add.test.js dist/__tests__/cli-cmd-remove.test.js dist/__tests__/cli-cmd-skill.test.js dist/__tests__/cli-cmd-test.test.js dist/__tests__/cli-cmd-workflow.test.js dist/__tests__/setup-skills-block.test.js dist/__tests__/setup-hooks.test.js dist/__tests__/setup-codex-hooks.test.js dist/__tests__/setup-agy-hooks.test.js dist/__tests__/trace.test.js",
|
|
17
|
+
"test:smoke": "npm run build && node --test dist/__tests__/utils.test.js dist/__tests__/template-vars.test.js dist/__tests__/platform.test.js dist/__tests__/colors.test.js dist/__tests__/config.test.js dist/__tests__/sync.test.js dist/__tests__/sync-apply.test.js dist/__tests__/sync-unretrievable.test.js dist/__tests__/sync-clean-check.test.js dist/__tests__/sync-lock.test.js dist/__tests__/auth-lock.test.js dist/__tests__/api-401-retry.test.js dist/__tests__/api-timeout.test.js dist/__tests__/push-cas.test.js dist/__tests__/upload.test.js dist/__tests__/progress.test.js dist/__tests__/updater.test.js dist/__tests__/cli-smoke.test.js dist/__tests__/claude-noninteractive.test.js dist/__tests__/claude-trust.test.js dist/__tests__/build-picker.test.js dist/__tests__/relay-state.test.js dist/__tests__/relay-daemon.test.js dist/__tests__/session-pool.test.js dist/__tests__/relay-diagnostics.test.js dist/__tests__/relay-agent-updates.test.js dist/__tests__/relay-installers.test.js dist/__tests__/relay-bridge-abort.test.js dist/__tests__/relay-redact.test.js dist/__tests__/relay-machine-id.test.js dist/__tests__/stream-json.test.js dist/__tests__/ingest-queue.test.js dist/__tests__/media-upload.test.js dist/__tests__/stream-delta.test.js dist/__tests__/phase-tracker.test.js dist/__tests__/relay-ingest-contract.test.js dist/__tests__/prompts.test.js dist/__tests__/capture-transcript.test.js dist/__tests__/capture-parsers.test.js dist/__tests__/agents.test.js dist/__tests__/capture-lock.test.js dist/__tests__/capture-resolve.test.js dist/__tests__/capture-metrics.test.js dist/__tests__/flag-aliases.test.js dist/__tests__/client-context.test.js dist/__tests__/adopt-cwd.test.js dist/__tests__/cli-cmd-agent.test.js dist/__tests__/cli-cmd-approval.test.js dist/__tests__/cli-cmd-audit.test.js dist/__tests__/cli-cmd-brand.test.js dist/__tests__/cli-cmd-bug.test.js dist/__tests__/cli-cmd-bug-queue.test.js dist/__tests__/cli-cmd-chat.test.js dist/__tests__/cli-cmd-credits.test.js dist/__tests__/cli-cmd-db.test.js dist/__tests__/cli-cmd-db-checkpoint.test.js dist/__tests__/cli-cmd-deploy.test.js dist/__tests__/cli-cmd-domain.test.js dist/__tests__/cli-cmd-email.test.js dist/__tests__/cli-cmd-file.test.js dist/__tests__/cli-cmd-storage.test.js dist/__tests__/cli-cmd-fn.test.js dist/__tests__/cli-cmd-service.test.js dist/__tests__/cli-cmd-job.test.js dist/__tests__/cli-cmd-generate.test.js dist/__tests__/cli-cmd-gmail.test.js dist/__tests__/cli-cmd-info.test.js dist/__tests__/cli-cmd-init.test.js dist/__tests__/cli-cmd-location.test.js dist/__tests__/cli-cmd-text.test.js dist/__tests__/cli-cmd-login.test.js dist/__tests__/cli-cmd-status.test.js dist/__tests__/cli-cmd-logout.test.js dist/__tests__/cli-cmd-token.test.js dist/__tests__/cli-cmd-key.test.js dist/__tests__/cli-cmd-logs.test.js dist/__tests__/cli-cmd-memory.test.js dist/__tests__/cli-cmd-page.test.js dist/__tests__/cli-cmd-plan.test.js dist/__tests__/cli-cmd-project.test.js dist/__tests__/cli-cmd-rbac.test.js dist/__tests__/cli-cmd-realtime.test.js dist/__tests__/cli-cmd-records.test.js dist/__tests__/cli-cmd-relay.test.js dist/__tests__/cli-cmd-setup.test.js dist/__tests__/cli-cmd-doctor.test.js dist/__tests__/claude-setup.test.js dist/__tests__/cli-cmd-sandbox.test.js dist/__tests__/cli-cmd-add.test.js dist/__tests__/cli-cmd-remove.test.js dist/__tests__/cli-cmd-skill.test.js dist/__tests__/cli-cmd-test.test.js dist/__tests__/cli-cmd-workflow.test.js dist/__tests__/setup-skills-block.test.js dist/__tests__/setup-hooks.test.js dist/__tests__/setup-codex-hooks.test.js dist/__tests__/setup-agy-hooks.test.js dist/__tests__/trace.test.js",
|
|
18
18
|
"test:smoke:quick": "node scripts/smoke-quick.mjs",
|
|
19
19
|
"test:e2e": "tsc && GIPITY_E2E=1 node --test --test-timeout=180000 dist/__tests__/cli-e2e-live.test.js dist/__tests__/cli-e2e-sync-live.test.js dist/__tests__/cli-e2e-sync-stress-live.test.js dist/__tests__/cli-e2e-rollback-live.test.js dist/__tests__/cli-e2e-services-media-live.test.js dist/__tests__/cli-e2e-workflow-live.test.js dist/__tests__/cli-e2e-sandbox-live.test.js dist/__tests__/cli-e2e-page-fetch-live.test.js dist/__tests__/cli-e2e-page-test-live.test.js",
|
|
20
20
|
"test:e2e:sync": "tsc && GIPITY_E2E=1 node --test --test-timeout=180000 dist/__tests__/cli-e2e-sync-live.test.js",
|