gemiterm 2.0.0 → 2.1.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 +32 -9
- package/package.json +13 -4
- package/src/cli/command-registry.ts +66 -62
- package/src/cli/commands/continue-command.ts +75 -1
- package/src/cli/commands/install-skills-command.ts +35 -0
- package/src/cli/commands/new-command.ts +62 -0
- package/src/cli/index.ts +19 -44
- package/src/cli/utils/long-arg-guard.ts +28 -0
- package/src/cli/utils/prompt-file.ts +26 -0
- package/src/infrastructure/cli-parser.ts +77 -0
- package/src/infrastructure/io.ts +9 -0
- package/src/services/skills-cli-driver.ts +58 -0
- package/src/services/skills-service.ts +52 -0
- package/.env +0 -2
- package/.github/workflows/manual-release.yml +0 -34
- package/.github/workflows/release.yml +0 -198
- package/.github/workflows/test.yml +0 -29
- package/.opencode/commands/opsx-apply.md +0 -152
- package/.opencode/commands/opsx-archive.md +0 -157
- package/.opencode/commands/opsx-explore.md +0 -169
- package/.opencode/commands/opsx-propose.md +0 -104
- package/.opencode/commands/opsx-sync.md +0 -140
- package/.opencode/commands/search-intelligently.md +0 -9
- package/.opencode/opencode.json +0 -20
- package/.opencode/skills/intellisearch/.version +0 -1
- package/.opencode/skills/intellisearch/SKILL.md +0 -84
- package/.opencode/skills/intellisearch/references/brave-search.md +0 -67
- package/.opencode/skills/intellisearch/references/ddg-search.md +0 -79
- package/.opencode/skills/intellisearch/references/deepwiki-tools.md +0 -246
- package/.opencode/skills/intellisearch/references/examples.md +0 -97
- package/.opencode/skills/intellisearch/references/gh-cli.md +0 -143
- package/.opencode/skills/intellisearch/references/google-search.md +0 -40
- package/.opencode/skills/intellisearch/references/search-workflow.md +0 -143
- package/.opencode/skills/intellisearch/references/workflow.md +0 -115
- package/.opencode/skills/openspec-apply-change/SKILL.md +0 -159
- package/.opencode/skills/openspec-archive-change/SKILL.md +0 -117
- package/.opencode/skills/openspec-explore/SKILL.md +0 -287
- package/.opencode/skills/openspec-propose/SKILL.md +0 -111
- package/.opencode/skills/openspec-sync-specs/SKILL.md +0 -147
- package/.serena/project.yml +0 -133
- package/AGENTS.md +0 -136
- package/CHANGELOG.md +0 -3
- package/bun.lock +0 -105
- package/docs/INSTALL.md +0 -185
- package/docs/PLAYWRIGHT_CLI_API.md +0 -306
- package/docs/python-release-for-reference.md +0 -175
- package/examples/sample_json_export.json +0 -32
- package/examples/sample_markdown_export.md +0 -221
- package/examples/usage_examples.sh +0 -222
- package/install.ps1 +0 -264
- package/install.sh +0 -275
- package/openspec/MAESTRO_MIGRATION.md +0 -180
- package/openspec/changes/archive/2026-06-08-command-spec-conformance/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-08-command-spec-conformance/design.md +0 -194
- package/openspec/changes/archive/2026-06-08-command-spec-conformance/proposal.md +0 -52
- package/openspec/changes/archive/2026-06-08-command-spec-conformance/specs/multi-profile-conversations/spec.md +0 -133
- package/openspec/changes/archive/2026-06-08-command-spec-conformance/tasks.md +0 -95
- package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/design.md +0 -28
- package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/proposal.md +0 -22
- package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/specs/interactive-prompt-loop/spec.md +0 -35
- package/openspec/changes/archive/2026-06-09-refactor-interactive-prompt-loop/tasks.md +0 -28
- package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/design.md +0 -323
- package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/proposal.md +0 -122
- package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/specs/no-capability-changes/spec.md +0 -29
- package/openspec/changes/archive/2026-06-09-replace-gemini-api-placeholder-with-gemini-reverse/tasks.md +0 -172
- package/openspec/changes/archive/2026-06-09-v2-install-migration/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-09-v2-install-migration/design.md +0 -241
- package/openspec/changes/archive/2026-06-09-v2-install-migration/proposal.md +0 -41
- package/openspec/changes/archive/2026-06-09-v2-install-migration/specs/v2-installer/spec.md +0 -205
- package/openspec/changes/archive/2026-06-09-v2-install-migration/tasks.md +0 -97
- package/openspec/changes/commander-cli-parser/.openspec.yaml +0 -2
- package/openspec/changes/commander-cli-parser/design.md +0 -107
- package/openspec/changes/commander-cli-parser/proposal.md +0 -31
- package/openspec/changes/commander-cli-parser/specs/cli/spec.md +0 -48
- package/openspec/changes/commander-cli-parser/tasks.md +0 -33
- package/openspec/changes/cross-platform-build-and-ci/.openspec.yaml +0 -2
- package/openspec/changes/cross-platform-build-and-ci/design.md +0 -213
- package/openspec/changes/cross-platform-build-and-ci/proposal.md +0 -50
- package/openspec/changes/cross-platform-build-and-ci/specs/path-and-file-mediation/spec.md +0 -335
- package/openspec/changes/cross-platform-build-and-ci/specs/release-pipeline/spec.md +0 -95
- package/openspec/changes/cross-platform-build-and-ci/tasks.md +0 -164
- package/openspec/config.yaml +0 -20
- package/openspec/specs/auth/spec.md +0 -394
- package/openspec/specs/cli/spec.md +0 -108
- package/openspec/specs/commands/spec.md +0 -409
- package/openspec/specs/configuration/spec.md +0 -130
- package/openspec/specs/conversations/spec.md +0 -139
- package/openspec/specs/domain-model/spec.md +0 -128
- package/openspec/specs/formatters/spec.md +0 -158
- package/openspec/specs/install-browser/spec.md +0 -146
- package/openspec/specs/interactive-prompt-loop/spec.md +0 -41
- package/openspec/specs/logger/spec.md +0 -71
- package/openspec/specs/mediator/spec.md +0 -72
- package/openspec/specs/multi-profile-conversations/spec.md +0 -145
- package/openspec/specs/path-utils/spec.md +0 -101
- package/openspec/specs/profiles/spec.md +0 -94
- package/openspec/specs/storage/spec.md +0 -198
- package/openspec/specs/testing/spec.md +0 -237
- package/openspec/specs/v2-installer/spec.md +0 -205
- package/openspec/specs/validators/spec.md +0 -65
- package/scripts/build.ts +0 -88
- package/scripts/clean-build.ps1 +0 -4
- package/scripts/clean-build.sh +0 -5
- package/scripts/install-browser.ps1 +0 -5
- package/scripts/install-browser.sh +0 -6
- package/scripts/lint-path-mediation.ps1 +0 -65
- package/scripts/lint-path-mediation.sh +0 -40
- package/tests/cli/auth-command.test.ts +0 -220
- package/tests/cli/command-registry.test.ts +0 -67
- package/tests/cli/continue-command.test.ts +0 -100
- package/tests/cli/delete-command.test.ts +0 -128
- package/tests/cli/export-all-command.test.ts +0 -375
- package/tests/cli/install-browser-command.test.ts +0 -48
- package/tests/cli/list-command.test.ts +0 -179
- package/tests/cli/new-command.test.ts +0 -139
- package/tests/cli/status-command.test.ts +0 -106
- package/tests/core/query-handlers.test.ts +0 -187
- package/tests/fixtures/auth-fixtures.ts +0 -98
- package/tests/fixtures/chat-fixtures.ts +0 -87
- package/tests/infrastructure/cli-table.test.ts +0 -107
- package/tests/infrastructure/formatters.test.ts +0 -202
- package/tests/infrastructure/io.test.ts +0 -197
- package/tests/infrastructure/logger.test.ts +0 -74
- package/tests/infrastructure/storage.test.ts +0 -335
- package/tests/infrastructure/validators.test.ts +0 -67
- package/tests/integration/commands/auth.test.ts +0 -186
- package/tests/integration/commands/continue.test.ts +0 -130
- package/tests/integration/commands/delete.test.ts +0 -140
- package/tests/integration/commands/export.test.ts +0 -266
- package/tests/integration/commands/fetch.test.ts +0 -238
- package/tests/integration/commands/list.test.ts +0 -281
- package/tests/integration/commands/profile.test.ts +0 -258
- package/tests/integration/commands/status.test.ts +0 -223
- package/tests/integration/installer-script-shape.test.ts +0 -67
- package/tests/parity/compare-outputs.ts +0 -359
- package/tests/parity/test-commands-parity.ps1 +0 -82
- package/tests/parity/test-commands-parity.sh +0 -61
- package/tests/services/auth-service.test.ts +0 -315
- package/tests/services/cookie-monitor.test.ts +0 -229
- package/tests/services/cookie-storage-service.test.ts +0 -230
- package/tests/services/gemini-client-wrapper.test.ts +0 -688
- package/tests/services/install-browser-service.test.ts +0 -83
- package/tests/services/playwright-cli-driver.test.ts +0 -468
- package/tests/services/profile-auth-manager.test.ts +0 -334
- package/tests/services/profile-service.test.ts +0 -224
- package/tests/setup.ts +0 -95
- package/tests/smoke/smoke.test.ts +0 -52
- package/tests/unit/config.test.ts +0 -159
- package/tests/unit/errors.test.ts +0 -119
- package/tests/unit/formatters.test.ts +0 -316
- package/tests/unit/mediator.test.ts +0 -152
- package/tests/unit/path-utils.test.ts +0 -289
- package/tsconfig.json +0 -16
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { describe, test, expect, beforeEach, afterEach, mock } from "bun:test";
|
|
2
|
-
import { CookieStorageService } from "../../src/services/cookie-storage-service.ts";
|
|
3
|
-
import { Logger } from "../../src/infrastructure/logger.ts";
|
|
4
|
-
import type { Cookie } from "../../src/core/types.ts";
|
|
5
|
-
import type { CookieStorage } from "../../src/infrastructure/storage.ts";
|
|
6
|
-
|
|
7
|
-
function makeFreshCookies(): Cookie[] {
|
|
8
|
-
const farFuture = Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60;
|
|
9
|
-
return [
|
|
10
|
-
{
|
|
11
|
-
name: "__Secure-1PSID",
|
|
12
|
-
value: "fresh-psid",
|
|
13
|
-
domain: ".google.com",
|
|
14
|
-
path: "/",
|
|
15
|
-
expires: farFuture,
|
|
16
|
-
httpOnly: true,
|
|
17
|
-
secure: true,
|
|
18
|
-
sameSite: "Lax",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "__Secure-1PSIDTS",
|
|
22
|
-
value: "fresh-psidts",
|
|
23
|
-
domain: ".google.com",
|
|
24
|
-
path: "/",
|
|
25
|
-
expires: farFuture,
|
|
26
|
-
httpOnly: true,
|
|
27
|
-
secure: true,
|
|
28
|
-
sameSite: "Lax",
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function makeExpiredCookies(): Cookie[] {
|
|
34
|
-
const past = Math.floor(Date.now() / 1000) - 30 * 24 * 60 * 60;
|
|
35
|
-
return [
|
|
36
|
-
{
|
|
37
|
-
name: "__Secure-1PSID",
|
|
38
|
-
value: "expired-psid",
|
|
39
|
-
domain: ".google.com",
|
|
40
|
-
path: "/",
|
|
41
|
-
expires: past,
|
|
42
|
-
httpOnly: true,
|
|
43
|
-
secure: true,
|
|
44
|
-
sameSite: "Lax",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "__Secure-1PSIDTS",
|
|
48
|
-
value: "expired-psidts",
|
|
49
|
-
domain: ".google.com",
|
|
50
|
-
path: "/",
|
|
51
|
-
expires: past,
|
|
52
|
-
httpOnly: true,
|
|
53
|
-
secure: true,
|
|
54
|
-
sameSite: "Lax",
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function makeStaleCookies(): Cookie[] {
|
|
60
|
-
const soon = Math.floor(Date.now() / 1000) + 3 * 24 * 60 * 60;
|
|
61
|
-
return [
|
|
62
|
-
{
|
|
63
|
-
name: "__Secure-1PSID",
|
|
64
|
-
value: "stale-psid",
|
|
65
|
-
domain: ".google.com",
|
|
66
|
-
path: "/",
|
|
67
|
-
expires: soon,
|
|
68
|
-
httpOnly: true,
|
|
69
|
-
secure: true,
|
|
70
|
-
sameSite: "Lax",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: "__Secure-1PSIDTS",
|
|
74
|
-
value: "stale-psidts",
|
|
75
|
-
domain: ".google.com",
|
|
76
|
-
path: "/",
|
|
77
|
-
expires: soon,
|
|
78
|
-
httpOnly: true,
|
|
79
|
-
secure: true,
|
|
80
|
-
sameSite: "Lax",
|
|
81
|
-
},
|
|
82
|
-
];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function makePartialCookies(): Cookie[] {
|
|
86
|
-
const farFuture = Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60;
|
|
87
|
-
return [
|
|
88
|
-
{
|
|
89
|
-
name: "__Secure-1PSID",
|
|
90
|
-
value: "only-psid",
|
|
91
|
-
domain: ".google.com",
|
|
92
|
-
path: "/",
|
|
93
|
-
expires: farFuture,
|
|
94
|
-
httpOnly: true,
|
|
95
|
-
secure: true,
|
|
96
|
-
sameSite: "Lax",
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function createMockCookieStorage(): CookieStorage {
|
|
102
|
-
return {
|
|
103
|
-
save: mock((_profileName: string, _cookies: Cookie[]) => {}),
|
|
104
|
-
load: mock((_profileName: string) => [] as Cookie[]),
|
|
105
|
-
delete: mock((_profileName: string) => {}),
|
|
106
|
-
list: mock(() => [] as string[]),
|
|
107
|
-
} as unknown as CookieStorage;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
describe("CookieStorageService", () => {
|
|
111
|
-
let storage: CookieStorage;
|
|
112
|
-
let service: CookieStorageService;
|
|
113
|
-
let logger: Logger;
|
|
114
|
-
|
|
115
|
-
beforeEach(() => {
|
|
116
|
-
storage = createMockCookieStorage();
|
|
117
|
-
logger = new Logger("test");
|
|
118
|
-
service = new CookieStorageService({ cookieStorage: storage, logger });
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
afterEach(() => {
|
|
122
|
-
mock.restore();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
describe("loadCookiesForProfile", () => {
|
|
126
|
-
test("returns cookie values from profile", () => {
|
|
127
|
-
storage.load = mock(() => makeFreshCookies()) as CookieStorage["load"];
|
|
128
|
-
|
|
129
|
-
const result = service.loadCookiesForProfile("default");
|
|
130
|
-
expect(result.secure_1psid).toBe("fresh-psid");
|
|
131
|
-
expect(result.secure_1psidts).toBe("fresh-psidts");
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
test("returns null for 1PSIDTS when missing", () => {
|
|
135
|
-
storage.load = mock(() => makePartialCookies()) as CookieStorage["load"];
|
|
136
|
-
|
|
137
|
-
const result = service.loadCookiesForProfile("default");
|
|
138
|
-
expect(result.secure_1psid).toBe("only-psid");
|
|
139
|
-
expect(result.secure_1psidts).toBeNull();
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
test("throws when __Secure-1PSID is missing", () => {
|
|
143
|
-
storage.load = mock(() => [
|
|
144
|
-
{
|
|
145
|
-
name: "__Secure-1PSIDTS",
|
|
146
|
-
value: "no-psid",
|
|
147
|
-
domain: ".google.com",
|
|
148
|
-
path: "/",
|
|
149
|
-
expires: -1,
|
|
150
|
-
httpOnly: true,
|
|
151
|
-
secure: true,
|
|
152
|
-
sameSite: "Lax",
|
|
153
|
-
},
|
|
154
|
-
]) as CookieStorage["load"];
|
|
155
|
-
|
|
156
|
-
expect(() => service.loadCookiesForProfile("default")).toThrow("Missing required cookie");
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
describe("validateCookies", () => {
|
|
161
|
-
test("returns true when both required cookies present", () => {
|
|
162
|
-
expect(service.validateCookies(makeFreshCookies())).toBe(true);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
test("returns false when __Secure-1PSIDTS is missing", () => {
|
|
166
|
-
expect(service.validateCookies(makePartialCookies())).toBe(false);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
test("returns false for empty array", () => {
|
|
170
|
-
expect(service.validateCookies([])).toBe(false);
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
describe("checkCookieFreshness", () => {
|
|
175
|
-
test("returns true when cookies expire far in the future", () => {
|
|
176
|
-
expect(service.checkCookieFreshness(makeFreshCookies())).toBe(true);
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
test("returns false when cookies are expired", () => {
|
|
180
|
-
expect(service.checkCookieFreshness(makeExpiredCookies())).toBe(false);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
test("returns false when cookies expire within 7 days", () => {
|
|
184
|
-
expect(service.checkCookieFreshness(makeStaleCookies())).toBe(false);
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
test("returns true when 1PSIDTS is a session cookie (expires: -1)", () => {
|
|
188
|
-
const sessionCookies: Cookie[] = [
|
|
189
|
-
{
|
|
190
|
-
name: "__Secure-1PSID",
|
|
191
|
-
value: "sid",
|
|
192
|
-
domain: ".google.com",
|
|
193
|
-
path: "/",
|
|
194
|
-
expires: -1,
|
|
195
|
-
httpOnly: true,
|
|
196
|
-
secure: true,
|
|
197
|
-
sameSite: "Lax",
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: "__Secure-1PSIDTS",
|
|
201
|
-
value: "sidts",
|
|
202
|
-
domain: ".google.com",
|
|
203
|
-
path: "/",
|
|
204
|
-
expires: -1,
|
|
205
|
-
httpOnly: true,
|
|
206
|
-
secure: true,
|
|
207
|
-
sameSite: "Lax",
|
|
208
|
-
},
|
|
209
|
-
];
|
|
210
|
-
expect(service.checkCookieFreshness(sessionCookies)).toBe(true);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
describe("getCookieExpiry", () => {
|
|
215
|
-
test("returns Date for valid expiry", () => {
|
|
216
|
-
const result = service.getCookieExpiry(makeFreshCookies());
|
|
217
|
-
expect(result).toBeInstanceOf(Date);
|
|
218
|
-
expect(result!.getTime()).toBeGreaterThan(Date.now());
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
test("returns null when __Secure-1PSIDTS has no positive expires", () => {
|
|
222
|
-
const noExpiry = makePartialCookies();
|
|
223
|
-
expect(service.getCookieExpiry(noExpiry)).toBeNull();
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
test("returns null for empty cookies", () => {
|
|
227
|
-
expect(service.getCookieExpiry([])).toBeNull();
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
});
|