@agent-watch-ai/edge 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/README.md +10 -6
- package/SECURITY.md +7 -4
- package/dist/cli/constants/cli.constants.d.ts +2 -0
- package/dist/cli/constants/cli.constants.js +3 -1
- package/dist/cli/doctor.js +13 -2
- package/dist/cli/setup.js +138 -29
- package/dist/cli/toggle.js +5 -1
- package/dist/cli/types/cli.types.d.ts +6 -0
- package/dist/cli/uninstall.js +1 -1
- package/dist/cli.js +14 -3
- package/dist/config/config-store.d.ts +1 -1
- package/dist/config/config-store.js +2 -2
- package/dist/config/constants/config.constants.d.ts +4 -1
- package/dist/config/constants/config.constants.js +7 -2
- package/dist/config/repo-config.js +1 -1
- package/dist/config/schemas/config.schema.d.ts +113 -767
- package/dist/config/schemas/config.schema.js +17 -8
- package/dist/credentials/constants/credentials.constants.d.ts +8 -0
- package/dist/credentials/constants/credentials.constants.js +9 -1
- package/dist/credentials/credential-status.js +8 -4
- package/dist/credentials/credentials.d.ts +16 -2
- package/dist/credentials/credentials.js +30 -5
- package/dist/credentials/device-api.d.ts +10 -1
- package/dist/credentials/device-api.js +12 -1
- package/dist/credentials/identity.d.ts +12 -1
- package/dist/credentials/identity.js +12 -1
- package/dist/credentials/migration.d.ts +1 -1
- package/dist/credentials/migration.js +1 -1
- package/dist/credentials/schemas/device-api.schema.d.ts +4 -51
- package/dist/credentials/schemas/device-state.schema.d.ts +3 -38
- package/dist/credentials/sign-in.d.ts +14 -1
- package/dist/credentials/sign-in.js +24 -5
- package/dist/credentials/types/credentials.types.d.ts +12 -1
- package/dist/enforcement/decision-client.js +2 -1
- package/dist/enforcement/enforcement.js +7 -5
- package/dist/enforcement/types/enforcement.types.d.ts +2 -2
- package/dist/git/code-state.d.ts +33 -0
- package/dist/git/code-state.js +44 -0
- package/dist/git/constants/git.constants.d.ts +6 -0
- package/dist/git/constants/git.constants.js +6 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +1 -0
- package/dist/git/types/git.types.d.ts +6 -0
- package/dist/pipeline/constants/pipeline.constants.d.ts +3 -0
- package/dist/pipeline/constants/pipeline.constants.js +3 -0
- package/dist/pipeline/hook-pipeline.js +56 -7
- package/dist/privacy/command-fingerprint.d.ts +42 -0
- package/dist/privacy/command-fingerprint.js +249 -0
- package/dist/privacy/constants/command-fingerprint.constants.d.ts +34 -0
- package/dist/privacy/constants/command-fingerprint.constants.js +38 -0
- package/dist/privacy/index.d.ts +3 -1
- package/dist/privacy/index.js +2 -0
- package/dist/privacy/product-capture.js +20 -0
- package/dist/privacy/types/privacy.types.d.ts +7 -0
- package/dist/providers/antigravity/antigravity.adapter.js +3 -0
- package/dist/providers/antigravity/schemas/antigravity.schema.d.ts +18 -492
- package/dist/providers/claude/claude.adapter.js +12 -1
- package/dist/providers/claude/constants/claude.constants.d.ts +6 -0
- package/dist/providers/claude/constants/claude.constants.js +6 -0
- package/dist/providers/claude/schemas/claude.schema.d.ts +1 -43
- package/dist/providers/codex/codex.adapter.js +14 -0
- package/dist/providers/codex/codex.otel.d.ts +12 -1
- package/dist/providers/codex/codex.otel.js +61 -11
- package/dist/providers/codex/constants/codex.otel.constants.d.ts +5 -0
- package/dist/providers/codex/constants/codex.otel.constants.js +5 -0
- package/dist/providers/codex/schemas/codex.schema.d.ts +1 -41
- package/dist/providers/constants/provider.constants.d.ts +8 -0
- package/dist/providers/constants/provider.constants.js +8 -0
- package/dist/providers/cursor/constants/cursor.constants.d.ts +2 -0
- package/dist/providers/cursor/constants/cursor.constants.js +2 -0
- package/dist/providers/cursor/cursor.adapter.js +84 -5
- package/dist/providers/cursor/schemas/cursor.schema.d.ts +5 -85
- package/dist/providers/gemini/constants/gemini.constants.d.ts +2 -0
- package/dist/providers/gemini/constants/gemini.constants.js +2 -0
- package/dist/providers/gemini/constants/gemini.otel.constants.d.ts +16 -1
- package/dist/providers/gemini/constants/gemini.otel.constants.js +16 -1
- package/dist/providers/gemini/gemini.detect.d.ts +11 -0
- package/dist/providers/gemini/gemini.detect.js +14 -1
- package/dist/providers/gemini/gemini.hooks.d.ts +3 -3
- package/dist/providers/gemini/gemini.hooks.js +5 -5
- package/dist/providers/gemini/gemini.otel.d.ts +14 -4
- package/dist/providers/gemini/gemini.otel.js +418 -107
- package/dist/providers/gemini/schemas/gemini.schema.d.ts +1 -49
- package/dist/providers/shared/bearer-rewrite.d.ts +19 -0
- package/dist/providers/shared/bearer-rewrite.js +46 -0
- package/dist/providers/shared/constants/tooling.constants.d.ts +6 -0
- package/dist/providers/shared/constants/tooling.constants.js +6 -0
- package/dist/providers/shared/event-builder.d.ts +17 -2
- package/dist/providers/shared/event-builder.js +43 -3
- package/dist/providers/shared/install-record.d.ts +2 -0
- package/dist/providers/shared/install-record.js +3 -2
- package/dist/providers/shared/tooling.d.ts +35 -0
- package/dist/providers/shared/tooling.js +61 -1
- package/dist/providers/shared/types/adapter.types.d.ts +18 -0
- package/dist/providers/types/provider.types.d.ts +24 -0
- package/dist/storage/atomic-file.d.ts +14 -0
- package/dist/storage/atomic-file.js +19 -0
- package/dist/storage/constants/storage.constants.d.ts +2 -0
- package/dist/storage/constants/storage.constants.js +2 -0
- package/dist/storage/schemas/storage.schema.d.ts +11 -175
- package/dist/storage/schemas/storage.schema.js +7 -1
- package/dist/transport/schemas/queue.schema.d.ts +1 -16
- package/dist/transport/schemas/queue.schema.js +1 -1
- package/dist/turns/constants/turns.constants.d.ts +17 -0
- package/dist/turns/constants/turns.constants.js +17 -0
- package/dist/turns/index.d.ts +3 -2
- package/dist/turns/index.js +1 -0
- package/dist/turns/tool-events.d.ts +15 -0
- package/dist/turns/tool-events.js +59 -0
- package/dist/turns/turn-state.js +2 -2
- package/dist/turns/turn-summary.d.ts +1 -1
- package/dist/turns/turn-summary.js +1 -0
- package/dist/turns/turn-tracker.js +138 -7
- package/dist/turns/types/turn-state.types.d.ts +28 -1
- package/dist/turns/types/turn-summary.types.d.ts +30 -0
- package/dist/turns/types/turn-tracker.types.d.ts +10 -0
- package/dist/turns/work-checkout.d.ts +5 -3
- package/dist/turns/work-checkout.js +46 -12
- package/docs/AUDIT_PROMPT.md +11 -0
- package/docs/DATA_HANDLING.md +69 -14
- package/docs/ENTERPRISE_DEPLOYMENT.md +21 -5
- package/package.json +9 -8
|
@@ -4,7 +4,7 @@ import { asRecord } from '../../core/object.js';
|
|
|
4
4
|
import { findExecutable } from '../../core/which.js';
|
|
5
5
|
import { readJsonFile } from '../../storage/json-file.js';
|
|
6
6
|
import { HOOK_COMMAND_MARKER } from '../constants/provider.constants.js';
|
|
7
|
-
import { GEMINI_CLI_VAR, GEMINI_EXECUTABLES, GEMINI_HOME_DIR, GEMINI_HOME_VAR, GEMINI_SETTINGS_FILE } from './constants/gemini.constants.js';
|
|
7
|
+
import { GEMINI_CLI_VAR, GEMINI_ENV_FILE, GEMINI_EXECUTABLES, GEMINI_HOME_DIR, GEMINI_HOME_VAR, GEMINI_SETTINGS_FILE } from './constants/gemini.constants.js';
|
|
8
8
|
/**
|
|
9
9
|
* Gemini CLI's configuration root.
|
|
10
10
|
*
|
|
@@ -23,6 +23,19 @@ function geminiHome(env) {
|
|
|
23
23
|
export function geminiSettingsPath(env) {
|
|
24
24
|
return path.join(geminiHome(env), GEMINI_SETTINGS_FILE);
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Where native telemetry is configured.
|
|
28
|
+
*
|
|
29
|
+
* Gemini CLI 0.63+ loads `~/.gemini/.env` into its process at start (for a
|
|
30
|
+
* trusted folder) but does not apply the settings.json `env` block, and its
|
|
31
|
+
* `telemetry` settings have no header option for the bearer.
|
|
32
|
+
*
|
|
33
|
+
* @param env - Environment supplying HOME and GEMINI_HOME.
|
|
34
|
+
* @returns Absolute path of the `.env` beside `settings.json`.
|
|
35
|
+
*/
|
|
36
|
+
export function geminiEnvPath(env) {
|
|
37
|
+
return path.join(geminiHome(env), GEMINI_ENV_FILE);
|
|
38
|
+
}
|
|
26
39
|
/**
|
|
27
40
|
* Whether Gemini CLI is installed here, and whether our hooks are registered.
|
|
28
41
|
*
|
|
@@ -11,9 +11,9 @@ export declare function installGeminiHooks(context: SetupContext): Promise<Setup
|
|
|
11
11
|
/**
|
|
12
12
|
* Remove AgentWatch's hooks from Gemini CLI's `settings.json`.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* file
|
|
14
|
+
* Only the hook fields are cleared: the telemetry record lives on, since
|
|
15
|
+
* telemetry is in `~/.gemini/.env` and its uninstall needs to know which lines
|
|
16
|
+
* and which file mode are ours.
|
|
17
17
|
*
|
|
18
18
|
* @param context - Environment, paths and current install state.
|
|
19
19
|
* @returns Whether the file changed, what to tell the user, and the next
|
|
@@ -2,7 +2,7 @@ import { asRecord } from '../../core/object.js';
|
|
|
2
2
|
import { backupFile } from '../../storage/atomic-file.js';
|
|
3
3
|
import { readJsonFile } from '../../storage/json-file.js';
|
|
4
4
|
import { registerOurHandlers, stripOurHandlers, sweepUnregisteredEvents, withHooksBlock, writeJsonValidated } from '../shared/hook-config.js';
|
|
5
|
-
import { withHookInstall,
|
|
5
|
+
import { withHookInstall, withoutHookInstall } from '../shared/install-record.js';
|
|
6
6
|
import { geminiSettingsPath } from './gemini.detect.js';
|
|
7
7
|
import { GEMINI_HOOK_EVENTS, GEMINI_HOOK_TIMEOUT_MILLISECONDS, GEMINI_MATCHED_EVENTS, GEMINI_PROVIDER_ID } from './constants/gemini.constants.js';
|
|
8
8
|
export { GEMINI_HOOK_EVENTS } from './constants/gemini.constants.js';
|
|
@@ -46,9 +46,9 @@ export async function installGeminiHooks(context) {
|
|
|
46
46
|
/**
|
|
47
47
|
* Remove AgentWatch's hooks from Gemini CLI's `settings.json`.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* file
|
|
49
|
+
* Only the hook fields are cleared: the telemetry record lives on, since
|
|
50
|
+
* telemetry is in `~/.gemini/.env` and its uninstall needs to know which lines
|
|
51
|
+
* and which file mode are ours.
|
|
52
52
|
*
|
|
53
53
|
* @param context - Environment, paths and current install state.
|
|
54
54
|
* @returns Whether the file changed, what to tell the user, and the next
|
|
@@ -57,7 +57,7 @@ export async function installGeminiHooks(context) {
|
|
|
57
57
|
export async function uninstallGeminiHooks(context) {
|
|
58
58
|
const settingsPath = geminiSettingsPath(context.env);
|
|
59
59
|
const read = await readJsonFile(settingsPath);
|
|
60
|
-
const forgotten =
|
|
60
|
+
const forgotten = withoutHookInstall(context.installState, GEMINI_PROVIDER_ID);
|
|
61
61
|
if (read.state === 'missing') {
|
|
62
62
|
return { ok: true, changed: false, messages: ['no Gemini settings file'], installState: forgotten };
|
|
63
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Env } from '../../core/types/core.types.js';
|
|
2
2
|
import type { AgentWatchConfig, OtelSignalName } from '../../config/types/config.types.js';
|
|
3
|
-
import type { NativeTelemetryConfigurator, NativeTelemetryStatus, SetupContext, SetupOutcome } from '../types/provider.types.js';
|
|
4
|
-
/** Configures Gemini CLI's own OTLP export. */
|
|
3
|
+
import type { BearerRewriteContext, NativeTelemetryConfigurator, NativeTelemetryStatus, SetupContext, SetupOutcome } from '../types/provider.types.js';
|
|
4
|
+
/** Configures Gemini CLI's own OTLP export, through `~/.gemini/.env` and settings.json. */
|
|
5
5
|
export declare class GeminiOtelConfigurator implements NativeTelemetryConfigurator {
|
|
6
6
|
/**
|
|
7
7
|
* Whether this agent can export native telemetry at all.
|
|
@@ -18,7 +18,7 @@ export declare class GeminiOtelConfigurator implements NativeTelemetryConfigurat
|
|
|
18
18
|
*/
|
|
19
19
|
inspect(context: SetupContext): Promise<NativeTelemetryStatus>;
|
|
20
20
|
/**
|
|
21
|
-
* Write the telemetry configuration into Gemini CLI's
|
|
21
|
+
* Write the telemetry configuration into Gemini CLI's `.env`.
|
|
22
22
|
*
|
|
23
23
|
* @param context - Environment, paths, config and install state.
|
|
24
24
|
* @returns Whether the file changed, what to tell the user, and the next
|
|
@@ -29,7 +29,7 @@ export declare class GeminiOtelConfigurator implements NativeTelemetryConfigurat
|
|
|
29
29
|
* Remove the telemetry configuration AgentWatch wrote.
|
|
30
30
|
*
|
|
31
31
|
* @param context - Environment, paths, config and install state.
|
|
32
|
-
* @returns Whether
|
|
32
|
+
* @returns Whether a file changed, what to tell the user, and the next
|
|
33
33
|
* install state.
|
|
34
34
|
*/
|
|
35
35
|
uninstall(context: SetupContext): Promise<SetupOutcome>;
|
|
@@ -47,6 +47,16 @@ export declare class GeminiOtelConfigurator implements NativeTelemetryConfigurat
|
|
|
47
47
|
* @returns The outcome.
|
|
48
48
|
*/
|
|
49
49
|
private configureDisabled;
|
|
50
|
+
/**
|
|
51
|
+
* Swap the bearer in our `OTEL_EXPORTER_OTLP_HEADERS` line for the current one.
|
|
52
|
+
*
|
|
53
|
+
* Only when a setup recorded the key as ours, and only the bearer in that
|
|
54
|
+
* line changes. No backup: one per rotation would collect copies of every token.
|
|
55
|
+
*
|
|
56
|
+
* @param context - The recorded file, its contents as read, install state and the current bearer.
|
|
57
|
+
* @returns True when the file was rewritten.
|
|
58
|
+
*/
|
|
59
|
+
rewriteBearer(context: BearerRewriteContext): Promise<boolean>;
|
|
50
60
|
/**
|
|
51
61
|
* Signals Gemini was asked for but will not be given under current consent.
|
|
52
62
|
*
|