aptly 0.1.9 → 0.1.11
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.en.md +10 -10
- package/README.ja.md +10 -10
- package/README.md +10 -10
- package/README.zh-CN.md +10 -10
- package/dist/bin/aptly-observe.d.ts +2 -0
- package/dist/bin/aptly-observe.js +66 -0
- package/dist/bin/aptly.js +59 -17
- package/dist/src/cli-help.js +18 -11
- package/dist/src/cli-input.d.ts +19 -1
- package/dist/src/cli-input.js +23 -11
- package/dist/src/policy-source.d.ts +3 -0
- package/dist/src/policy-source.js +11 -0
- package/dist/src/server.d.ts +1 -1
- package/dist/src/server.js +44 -2
- package/dist/src/setup.d.ts +69 -0
- package/dist/src/setup.js +605 -6
- package/dist/src/statistics-codex.d.ts +23 -0
- package/dist/src/statistics-codex.js +121 -0
- package/dist/src/statistics-policy.d.ts +2 -0
- package/dist/src/statistics-policy.js +20 -0
- package/dist/src/statistics.d.ts +90 -0
- package/dist/src/statistics.js +472 -0
- package/dist/src/transmission-review-cli.d.ts +11 -0
- package/dist/src/transmission-review-cli.js +35 -0
- package/dist/src/update-notifier.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/ADVISORY_USAGE.md +1 -1
- package/docs/DRAFT_0_1_0.md +1 -1
- package/docs/guide/en/advanced.md +217 -0
- package/docs/guide/en/benchmarks.md +32 -0
- package/docs/guide/en/budget.md +45 -0
- package/docs/guide/en/configuration.md +104 -0
- package/docs/guide/en/installation.md +114 -0
- package/docs/guide/en/routing.md +61 -0
- package/docs/guide/en/statistics.md +43 -0
- package/docs/guide/en/transmission.md +71 -0
- package/docs/guide/en/troubleshooting.md +99 -0
- package/docs/guide/en.md +80 -477
- package/docs/guide/ja/advanced.md +217 -0
- package/docs/guide/ja/benchmarks.md +32 -0
- package/docs/guide/ja/budget.md +45 -0
- package/docs/guide/ja/configuration.md +104 -0
- package/docs/guide/ja/installation.md +114 -0
- package/docs/guide/ja/routing.md +61 -0
- package/docs/guide/ja/statistics.md +43 -0
- package/docs/guide/ja/transmission.md +71 -0
- package/docs/guide/ja/troubleshooting.md +99 -0
- package/docs/guide/ja.md +80 -477
- package/docs/guide/ko/advanced.md +217 -0
- package/docs/guide/ko/benchmarks.md +32 -0
- package/docs/guide/ko/budget.md +45 -0
- package/docs/guide/ko/configuration.md +104 -0
- package/docs/guide/ko/installation.md +114 -0
- package/docs/guide/ko/routing.md +61 -0
- package/docs/guide/ko/statistics.md +43 -0
- package/docs/guide/ko/transmission.md +71 -0
- package/docs/guide/ko/troubleshooting.md +99 -0
- package/docs/guide/ko.md +80 -477
- package/docs/guide/zh-CN/advanced.md +217 -0
- package/docs/guide/zh-CN/benchmarks.md +32 -0
- package/docs/guide/zh-CN/budget.md +45 -0
- package/docs/guide/zh-CN/configuration.md +104 -0
- package/docs/guide/zh-CN/installation.md +114 -0
- package/docs/guide/zh-CN/routing.md +61 -0
- package/docs/guide/zh-CN/statistics.md +43 -0
- package/docs/guide/zh-CN/transmission.md +71 -0
- package/docs/guide/zh-CN/troubleshooting.md +99 -0
- package/docs/guide/zh-CN.md +80 -477
- package/package.json +3 -2
package/dist/src/cli-input.js
CHANGED
|
@@ -47,12 +47,19 @@ export async function readEnvironmentValue({ key, fromStdin = false }) {
|
|
|
47
47
|
process.stdout.write('\n');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
51
|
-
export
|
|
52
|
-
|
|
50
|
+
/** Lifecycle, CI and redirected output are never interactive consent. */
|
|
51
|
+
export function canPromptTransmission({ env = process.env, stdinIsTTY = !!process.stdin.isTTY, stdoutIsTTY = !!process.stdout.isTTY, stderrIsTTY = !!process.stderr.isTTY } = {}) {
|
|
52
|
+
return stdinIsTTY && stdoutIsTTY && stderrIsTTY && !env.CI && env.APTLY_SKIP_SETUP !== '1' && !env.npm_lifecycle_event;
|
|
53
|
+
}
|
|
54
|
+
/** Read one actual operator answer. Prompts/terminal echo stay on stderr, JSON on stdout. */
|
|
55
|
+
export async function readTransmissionReviewChoice(candidates) {
|
|
56
|
+
if (!canPromptTransmission())
|
|
53
57
|
throw fail('set_interactive_input_required');
|
|
54
|
-
process.
|
|
55
|
-
|
|
58
|
+
process.stderr.write('Review automatic task information sent to the OpenAI Decisions API (not Aptly developers).\nDescriptions and excerpts may contain sensitive information; this is not anonymization.\nCurrent configured scope:\n');
|
|
59
|
+
for (const c of candidates)
|
|
60
|
+
process.stderr.write(' ' + c.client + ' (' + c.selected_home_source + ' home): ' + c.transmission + ' [' + (c.transmission_source === 'legacy' ? 'legacy v1' : c.transmission_source === 'explicit' ? 'explicit v2' : 'unselected') + ']; ' + c.application_mode + ', ' + (c.enabled ? 'enabled' : 'disabled') + '\n');
|
|
61
|
+
process.stderr.write(' 1. none — No automatic transmission\n 2. description — Caller-provided descriptions only\n 3. excerpt — Bounded task-name/body excerpts and descriptions (Recommended)\n Enter / keep — Keep configured scopes; unselected becomes none\n');
|
|
62
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr, terminal: true });
|
|
56
63
|
try {
|
|
57
64
|
return await new Promise((resolve, reject) => {
|
|
58
65
|
let settled = false;
|
|
@@ -62,16 +69,16 @@ export async function readTransmissionChoice() {
|
|
|
62
69
|
} };
|
|
63
70
|
rl.once('SIGINT', () => { cancel(); rl.close(); });
|
|
64
71
|
rl.once('close', cancel);
|
|
65
|
-
const ask = () => rl.question('Transmission scope [
|
|
66
|
-
const choices = { '': '
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
process.
|
|
72
|
+
const ask = () => rl.question('Transmission scope [Enter: keep / unselected: none]: ', value => {
|
|
73
|
+
const choices = { '': 'keep', keep: 'keep', '1': 'none', none: 'none', '2': 'description', description: 'description', '3': 'excerpt', excerpt: 'excerpt' };
|
|
74
|
+
const selected = value.trim().toLowerCase();
|
|
75
|
+
if (!Object.hasOwn(choices, selected)) {
|
|
76
|
+
process.stderr.write('Choose 1, 2, 3 or keep.\n');
|
|
70
77
|
ask();
|
|
71
78
|
return;
|
|
72
79
|
}
|
|
73
80
|
settled = true;
|
|
74
|
-
resolve(
|
|
81
|
+
resolve(choices[selected]);
|
|
75
82
|
});
|
|
76
83
|
ask();
|
|
77
84
|
});
|
|
@@ -80,3 +87,8 @@ export async function readTransmissionChoice() {
|
|
|
80
87
|
rl.close();
|
|
81
88
|
}
|
|
82
89
|
}
|
|
90
|
+
/** Compatibility for the former initial-only input helper. */
|
|
91
|
+
export async function readTransmissionChoice() {
|
|
92
|
+
const result = await readTransmissionReviewChoice([]);
|
|
93
|
+
return result === 'keep' ? 'none' : result;
|
|
94
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CODEX_HOME_POLICY_SOURCE = "@codex-home";
|
|
2
|
+
/** Resolve only the explicit Codex selector; existing fixed paths remain unchanged. */
|
|
3
|
+
export declare function resolvePolicySource(value: string | undefined, env: NodeJS.ProcessEnv, _home?: string): string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isAbsolute, join } from 'node:path';
|
|
2
|
+
export const CODEX_HOME_POLICY_SOURCE = '@codex-home';
|
|
3
|
+
/** Resolve only the explicit Codex selector; existing fixed paths remain unchanged. */
|
|
4
|
+
export function resolvePolicySource(value, env, _home) {
|
|
5
|
+
if (value !== CODEX_HOME_POLICY_SOURCE)
|
|
6
|
+
return value;
|
|
7
|
+
const codexHome = env.CODEX_HOME;
|
|
8
|
+
if (codexHome === undefined || !codexHome.trim() || !isAbsolute(codexHome) || /[\x00-\x1f\x7f-\x9f]/.test(codexHome))
|
|
9
|
+
throw new Error('policy_source_home_invalid');
|
|
10
|
+
return join(codexHome, 'aptly', 'auto-policy.json');
|
|
11
|
+
}
|
package/dist/src/server.d.ts
CHANGED
package/dist/src/server.js
CHANGED
|
@@ -11,6 +11,8 @@ import { automaticHook, effectiveTransmission, loadAutomaticHookPolicy, initialH
|
|
|
11
11
|
import { SpawnContexts } from './spawn-context.js';
|
|
12
12
|
import { RoutingObservations } from './routing-observations.js';
|
|
13
13
|
import { ContextRetries } from './context-retry.js';
|
|
14
|
+
import { statisticsState } from './statistics-policy.js';
|
|
15
|
+
import { CODEX_HOME_POLICY_SOURCE, resolvePolicySource } from './policy-source.js';
|
|
14
16
|
const taskSchema = z.object({ summary: z.string().min(1).max(4000), operation: z.enum(['read_only', 'write', 'review', 'analysis']), context_sufficient: z.boolean() }).strict();
|
|
15
17
|
const constraintsSchema = z.object({ model_pinned: z.boolean().optional(), effort_pinned: z.boolean().optional(), role_pinned: z.boolean().optional(), fork_inherits: z.boolean().optional(), provenance_verified: z.boolean().optional() }).strict();
|
|
16
18
|
const hookSchema = { client: z.enum(['codex', 'claude']), event: z.record(z.string(), z.unknown()) };
|
|
@@ -20,12 +22,40 @@ const observationSchema = z.object({ client: hookSchema.client.optional(), event
|
|
|
20
22
|
ctx.addIssue({ code: 'custom', message: 'Supply only {client,event} or only {retry_id}.' });
|
|
21
23
|
});
|
|
22
24
|
const content = (result) => ({ content: [{ type: 'text', text: JSON.stringify(result) }], structuredContent: result });
|
|
23
|
-
export function createServer({ env = process.env } = {}) {
|
|
25
|
+
export function createServer({ env: inputEnv = process.env } = {}) {
|
|
26
|
+
const codexBound = inputEnv.APTLY_HOOK_POLICY_PATH === CODEX_HOME_POLICY_SOURCE;
|
|
27
|
+
const env = { ...inputEnv, APTLY_HOOK_POLICY_PATH: resolvePolicySource(inputEnv.APTLY_HOOK_POLICY_PATH, inputEnv) };
|
|
24
28
|
const { router, budget, mode, modelInfo, credentialStatus, disabledClients } = runtime(env);
|
|
25
29
|
const observations = new RoutingObservations();
|
|
26
30
|
const contexts = new SpawnContexts();
|
|
27
31
|
const retries = new ContextRetries(router, env.APTLY_HOOK_POLICY_PATH);
|
|
28
32
|
const server = new McpServer({ name: 'aptly', version: VERSION });
|
|
33
|
+
// Durable statistics are a separate, opt-in best-effort projection after routing settles.
|
|
34
|
+
const trackStatistics = async (client, input) => {
|
|
35
|
+
if (process.platform === 'win32')
|
|
36
|
+
return;
|
|
37
|
+
try {
|
|
38
|
+
const stateDirectory = statisticsState(env.APTLY_HOOK_POLICY_PATH);
|
|
39
|
+
if (!stateDirectory)
|
|
40
|
+
return;
|
|
41
|
+
const stats = await import('./statistics.js'), options = { stateDirectory };
|
|
42
|
+
if (!stats.loadStatisticsConfig(options)?.enabled_clients.includes(client))
|
|
43
|
+
return;
|
|
44
|
+
const observation = input.observation, result = input.recommendation;
|
|
45
|
+
const profileId = typeof observation?.profile_id === 'string' ? observation.profile_id : typeof result?.profile_id === 'string' ? result.profile_id : undefined;
|
|
46
|
+
const profile = router.policy.profiles.find(p => p.id === profileId && p.client === client);
|
|
47
|
+
const expected = profile ? { profileId: profile.id, model: profile.model, ...(profile.reasoning_effort ? { effort: profile.reasoning_effort } : {}), catalogVersion: router.policy.catalog_version } : undefined;
|
|
48
|
+
if (input.event && observation) {
|
|
49
|
+
const disposition = observation.status === 'arguments_updated' ? 'auto' : observation.status === 'advisory' ? 'advisory' : ['blocked', 'awaiting_context'].includes(String(observation.status)) ? 'blocked' : String(observation.reason).startsWith('explicit_') ? 'explicit_preserved' : undefined;
|
|
50
|
+
if (!disposition)
|
|
51
|
+
return;
|
|
52
|
+
stats.recordStatisticsRecommendation(options, { client, sessionId: typeof input.event.session_id === 'string' ? input.event.session_id : undefined, toolUseId: typeof (input.event.tool_use_id ?? input.event.tool_call_id) === 'string' ? String(input.event.tool_use_id ?? input.event.tool_call_id) : undefined, requestId: typeof observation.request_id === 'string' ? observation.request_id : undefined, disposition, expected });
|
|
53
|
+
}
|
|
54
|
+
else if (expected && input.requestId && (result?.status === 'recommended' || result?.status === 'prepared'))
|
|
55
|
+
stats.recordStatisticsRecommendation(options, { client, requestId: input.requestId, disposition: 'unbound', expected });
|
|
56
|
+
}
|
|
57
|
+
catch { /* Statistics never alter provider, budget, Hook output or execution. */ }
|
|
58
|
+
};
|
|
29
59
|
const annotations = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: mode === 'decisions' };
|
|
30
60
|
const evidence = (client, event) => {
|
|
31
61
|
const config = loadConfiguration(env);
|
|
@@ -41,6 +71,7 @@ export function createServer({ env = process.env } = {}) {
|
|
|
41
71
|
recommendation: { application: 'advisory_only', host_evidence_required: false, constraints: 'caller_declared_pins' },
|
|
42
72
|
model_information: { status: modelInfo.status, refresh: 'explicit_only', account_access_verified: false }, disabled_clients: disabledClients,
|
|
43
73
|
credential_status: credentialStatus,
|
|
74
|
+
execution_statistics: { collection: 'explicit_operator_opt_in', view: 'aptly stats', semantics: 'host_reported_model_evidence_not_user_acceptance', effective_effort: 'not_measured', usage_rollups: 'not_collected' },
|
|
44
75
|
automatic_hook: { status: automatic.reason, mode: automatic.policy?.mode ?? 'disabled', transmission: automatic.policy ? effectiveTransmission(automatic.policy) : null, transmission_provenance: automatic.policy ? (automatic.policy.schema_version === 1 ? 'legacy_v1_default' : 'operator_policy_v2') : 'unavailable', host_settings_verified: false, context_tool: 'prepare_spawn_context', context_scope: 'this_process_exact_event_5_minutes', context_retry_tool: 'retry_spawn_recommendation', context_retry_limit: 1, fresh_delegation_tool: 'prepare_fresh_delegation', fresh_delegation_intent: 'caller_declared_not_verified', observation_tool: 'get_spawn_routing_observation', observation_scope: 'this_process_recent_calls', execution_observation: 'not_supported',
|
|
45
76
|
guarantee: { scope: 'enabled_trusted_connected_supported_hook_only', missing_hook_detectable: false, unavailable_host_hook: 'host_controls_fallback', eligible_defaults_failure: 'deny_when_transmission_enabled', inherited_application: 'defaults_deny_advisory_feedback', caller_recovery: 'model_driven_not_guaranteed' } },
|
|
46
77
|
});
|
|
@@ -54,6 +85,8 @@ export function createServer({ env = process.env } = {}) {
|
|
|
54
85
|
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
55
86
|
inputSchema: { ...hookSchema, description: z.string().max(4000) }
|
|
56
87
|
}, async ({ client, event, description }, extra) => {
|
|
88
|
+
if (codexBound && client !== 'codex')
|
|
89
|
+
return content({ status: 'rejected', reason: 'policy_source_client_mismatch' });
|
|
57
90
|
const policy = loadAutomaticHookPolicy(env.APTLY_HOOK_POLICY_PATH);
|
|
58
91
|
if (!policy.policy?.enabled)
|
|
59
92
|
return content({ status: 'rejected', reason: policy.reason });
|
|
@@ -70,7 +103,7 @@ export function createServer({ env = process.env } = {}) {
|
|
|
70
103
|
server.registerTool('recommend_agent', {
|
|
71
104
|
description: 'Recommend an allowlisted profile for a supplied task only; never inspects host settings, spawns, or authorizes an agent. Optional constraints describe caller-declared choices to preserve; omitted flags are not claims about current host settings. Decisions mode may incur a bounded classification request.', annotations,
|
|
72
105
|
inputSchema: { request_id: z.string().min(1).max(96), client: z.enum(['codex', 'claude']), task: taskSchema, eligible_profile_ids: z.array(z.string()).min(1).max(20).optional(), constraints: constraintsSchema.optional() }
|
|
73
|
-
}, async (input) =>
|
|
106
|
+
}, async (input) => { const result = await router.advise(input); await trackStatistics(input.client, { requestId: input.request_id, recommendation: result }); return content({ ...result, provider: mode }); });
|
|
74
107
|
server.registerTool('retry_spawn_recommendation', {
|
|
75
108
|
description: 'Supply one bounded task description after an Aptly Hook returns needs_context and a retry_id. Use the same MCP process within five minutes; no native call IDs are needed. May make one paid classification; duplicate input reuses its request identity, changed input conflicts. Never spawns or changes history. If still needs_context/unavailable, stop; do not create another ID. A blocked spawn_application remains advisory.',
|
|
76
109
|
annotations, inputSchema: { retry_id: z.string().regex(/^[a-f0-9]{64}$/), description: z.string().max(4000) }
|
|
@@ -83,6 +116,9 @@ export function createServer({ env = process.env } = {}) {
|
|
|
83
116
|
result = { status: 'unavailable', reason: 'context_retry_unavailable', application: 'advisory_only', retry_id, context_retry_allowed: false };
|
|
84
117
|
}
|
|
85
118
|
observations.recordRetry(retry_id, result);
|
|
119
|
+
const client = typeof result.profile === 'object' && result.profile && 'client' in result.profile ? result.profile.client : undefined;
|
|
120
|
+
if (client === 'codex' || client === 'claude')
|
|
121
|
+
await trackStatistics(client, { requestId: retry_id, recommendation: result });
|
|
86
122
|
return content(result);
|
|
87
123
|
});
|
|
88
124
|
server.registerTool('prepare_fresh_delegation', {
|
|
@@ -92,6 +128,7 @@ export function createServer({ env = process.env } = {}) {
|
|
|
92
128
|
}, async ({ retry_id, task_name, standalone_task, declaration }, extra) => {
|
|
93
129
|
const result = retries.prepareFresh(retry_id, task_name, standalone_task, declaration, extra.signal);
|
|
94
130
|
observations.recordFresh(retry_id, result);
|
|
131
|
+
await trackStatistics('codex', { requestId: retry_id, recommendation: result });
|
|
95
132
|
return content(result);
|
|
96
133
|
});
|
|
97
134
|
server.registerTool('get_routing_precedence', {
|
|
@@ -105,9 +142,14 @@ export function createServer({ env = process.env } = {}) {
|
|
|
105
142
|
inputSchema: { ...hookSchema, task: taskSchema.optional() }
|
|
106
143
|
}, async ({ client, event, task }, extra) => {
|
|
107
144
|
observations.begin(client, event);
|
|
145
|
+
if (codexBound && client !== 'codex') {
|
|
146
|
+
observations.record({ ...initialHookObservation(client, event), status: 'preserved', reason: 'policy_source_client_mismatch' });
|
|
147
|
+
return { content: [{ type: 'text', text: '{}' }] };
|
|
148
|
+
}
|
|
108
149
|
if (env.APTLY_HOOK_POLICY_PATH !== undefined) {
|
|
109
150
|
const result = await automaticHook({ client, event, router, policyPath: env.APTLY_HOOK_POLICY_PATH, signal: extra.signal, context: () => contexts.lookup(client, event), onObservation: value => observations.record(value), onNeedsContext: (seed, current) => retries.register(seed, current), onBlockedAdvice: (seed, current) => retries.registerAdvice(seed, current) });
|
|
110
151
|
observations.record(result.observation);
|
|
152
|
+
await trackStatistics(client, { event, observation: result.observation });
|
|
111
153
|
return { content: [{ type: 'text', text: JSON.stringify(result.output) }] };
|
|
112
154
|
}
|
|
113
155
|
const input = hookInput({ client, event, policy: router.policy });
|
package/dist/src/setup.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface SetupClientResult {
|
|
|
22
22
|
recovery?: string[];
|
|
23
23
|
transmission?: string;
|
|
24
24
|
transmission_source?: 'explicit' | 'legacy' | 'unselected';
|
|
25
|
+
transmission_review?: 'required' | 'complete';
|
|
25
26
|
budget?: {
|
|
26
27
|
limits: Record<string, number>;
|
|
27
28
|
added: string[];
|
|
@@ -52,8 +53,26 @@ export declare function prepareCredentialReference(options: SetupOptions, client
|
|
|
52
53
|
};
|
|
53
54
|
/** Preserved standard registrations require a separate explicit opt-in; ownership stays unchanged. */
|
|
54
55
|
export declare function migrateLauncher(options: SetupOptions, dryRun?: boolean, includeExisting?: boolean): SetupResult;
|
|
56
|
+
/** Explicitly select a per-Codex-home policy without moving any state. */
|
|
57
|
+
export declare function setPolicySource(options: SetupOptions, dryRun?: boolean): SetupResult;
|
|
55
58
|
/** Explicit operator change; updates policy and its receipt through normal guarded staging. */
|
|
56
59
|
export declare function setTransmission(scope: TransmissionScope, options?: SetupOptions): SetupResult;
|
|
60
|
+
export type TransmissionReviewCandidate = {
|
|
61
|
+
client: Client;
|
|
62
|
+
transmission: TransmissionScope | 'unselected';
|
|
63
|
+
transmission_source: 'legacy' | 'explicit' | 'unselected';
|
|
64
|
+
selected_home_source: 'default' | 'override';
|
|
65
|
+
application_mode: 'defaults' | 'advisory';
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
};
|
|
68
|
+
/** Read-only, two-phase local acknowledgement. Recheck every captured host before writing. */
|
|
69
|
+
export declare function prepareTransmissionReview(options?: SetupOptions & {
|
|
70
|
+
forceReview?: boolean;
|
|
71
|
+
}): {
|
|
72
|
+
result: SetupResult;
|
|
73
|
+
candidates: TransmissionReviewCandidate[];
|
|
74
|
+
apply(choice: 'keep' | TransmissionScope): SetupResult;
|
|
75
|
+
};
|
|
57
76
|
/** Read-only redacted policy state. Does not create host directories or contact a provider. */
|
|
58
77
|
export declare function showTransmission(options?: SetupOptions): {
|
|
59
78
|
clients: ({
|
|
@@ -62,6 +81,7 @@ export declare function showTransmission(options?: SetupOptions): {
|
|
|
62
81
|
code: string;
|
|
63
82
|
application_mode?: undefined;
|
|
64
83
|
enabled?: undefined;
|
|
84
|
+
transmission_review?: undefined;
|
|
65
85
|
transmission?: undefined;
|
|
66
86
|
transmission_source?: undefined;
|
|
67
87
|
} | {
|
|
@@ -70,6 +90,7 @@ export declare function showTransmission(options?: SetupOptions): {
|
|
|
70
90
|
status: string;
|
|
71
91
|
application_mode: "advisory" | "defaults";
|
|
72
92
|
enabled: boolean;
|
|
93
|
+
transmission_review: string;
|
|
73
94
|
transmission: import("./automatic-hook.ts").Transmission;
|
|
74
95
|
transmission_source: string;
|
|
75
96
|
})[];
|
|
@@ -115,4 +136,52 @@ export declare function showBudgetStatus(options?: SetupOptions): {
|
|
|
115
136
|
codes: string[];
|
|
116
137
|
})[];
|
|
117
138
|
};
|
|
139
|
+
/** Explicit collection controls; legacy routing receipt and model/credential settings stay untouched. */
|
|
140
|
+
export declare function setStatisticsCollection(enabled: boolean, options?: SetupOptions & {
|
|
141
|
+
codexNativeMetadata?: boolean;
|
|
142
|
+
}): SetupResult;
|
|
143
|
+
/** Snapshot view; no runtime, credentials, provider, budget gate or state creation. */
|
|
144
|
+
export declare function showStatistics(options?: SetupOptions, today?: boolean): {
|
|
145
|
+
clients: ({
|
|
146
|
+
status: string;
|
|
147
|
+
scope: string;
|
|
148
|
+
semantics: string;
|
|
149
|
+
observation_completeness: string;
|
|
150
|
+
today_basis: string;
|
|
151
|
+
filter: {
|
|
152
|
+
client: "all" | import("./types.ts").Client;
|
|
153
|
+
today: boolean;
|
|
154
|
+
};
|
|
155
|
+
collection: {
|
|
156
|
+
codex: boolean;
|
|
157
|
+
claude: boolean;
|
|
158
|
+
};
|
|
159
|
+
capacity: {
|
|
160
|
+
delegations: number;
|
|
161
|
+
children: number;
|
|
162
|
+
reached: boolean;
|
|
163
|
+
};
|
|
164
|
+
delegations: number;
|
|
165
|
+
auto: Record<import("./statistics.ts").ModelState, number>;
|
|
166
|
+
advisory: Record<import("./statistics.ts").ModelState, number>;
|
|
167
|
+
blocked: number;
|
|
168
|
+
explicit_preserved: number;
|
|
169
|
+
unbound: number;
|
|
170
|
+
effort_actual_unknown: number;
|
|
171
|
+
application_confirmed: number;
|
|
172
|
+
unknown_alias_count: number;
|
|
173
|
+
model_observed: number;
|
|
174
|
+
model_comparable: number;
|
|
175
|
+
model_match_denominator: number;
|
|
176
|
+
observation_denominator: number;
|
|
177
|
+
usage_scope: string;
|
|
178
|
+
model_alias_scope: string;
|
|
179
|
+
counts_are_lifetime: boolean;
|
|
180
|
+
client: Client;
|
|
181
|
+
} | {
|
|
182
|
+
client: Client;
|
|
183
|
+
status: string;
|
|
184
|
+
collection: string;
|
|
185
|
+
})[];
|
|
186
|
+
};
|
|
118
187
|
export {};
|