@agenttrail/cli 0.2.0 → 0.2.2

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/dist/index.d.cts CHANGED
@@ -99,6 +99,7 @@ interface LoginEnv {
99
99
  readonly projectSlug?: string;
100
100
  readonly captureContent?: boolean;
101
101
  readonly global?: boolean;
102
+ readonly setup?: boolean;
102
103
  readonly host: string;
103
104
  readonly fetchFn?: FetchFn$1;
104
105
  readonly sleepFn?: SleepFn;
@@ -275,6 +276,7 @@ interface MapOptions {
275
276
  readonly captureContent: boolean;
276
277
  readonly scopeVersion?: string;
277
278
  readonly resolved?: ResolvedScrubbers | null;
279
+ readonly provenance?: "backfill" | "live";
278
280
  }
279
281
  declare function sessionToResourceSpans(session: ParsedSession, opts: MapOptions): BackfillResourceSpans;
280
282
 
@@ -420,6 +422,39 @@ declare function buildSpanTree(session: ParsedSession): SpanNode[];
420
422
 
421
423
  type FetchFn = typeof fetch;
422
424
 
425
+ interface StateIO {
426
+ readFile?: (p: string) => string;
427
+ writeFile?: (p: string, c: string, mode?: number) => void;
428
+ mkdir?: (p: string, mode: number) => void;
429
+ }
430
+
431
+ interface CaptureLogEntry {
432
+ readonly event?: string;
433
+ readonly session?: string;
434
+ readonly outcome: string;
435
+ readonly reason?: string;
436
+ readonly traces?: number;
437
+ readonly sent?: number;
438
+ readonly spans?: number;
439
+ readonly httpStatus?: number;
440
+ readonly project?: string;
441
+ }
442
+ interface CaptureContext {
443
+ readonly env: NodeJS.ProcessEnv;
444
+ readonly homeDir: string;
445
+ readonly endpointFlag?: string;
446
+ readonly readStdin?: () => Promise<string>;
447
+ readonly spawnWorker?: (payload: string) => void;
448
+ readonly armDeadline?: (ms: number) => void;
449
+ readonly sleep?: (ms: number) => Promise<void>;
450
+ readonly upload?: UploadDeps;
451
+ readonly stateIO?: StateIO;
452
+ readonly loginEnv?: Partial<LoginEnv>;
453
+ readonly managedPaths?: readonly string[];
454
+ readonly log?: (entry: CaptureLogEntry) => void;
455
+ }
456
+ declare function runCaptureCommand(ctx: CaptureContext): Promise<number>;
457
+
423
458
  declare const AGENTTRAIL_PROJECT_NS: "18a5d968-0fa2-5c8a-88da-0b29d80105d4";
424
459
  declare const AGENTTRAIL_AGENT_NS: "7f050af4-796e-5b05-94c2-dba78bcdc7c2";
425
460
  declare const AGENTTRAIL_INGEST_ENDPOINT: "https://ingest.agenttrail.sh";
@@ -554,6 +589,8 @@ interface CliIO {
554
589
  fetchFn?: FetchFn;
555
590
  pluginRunner?: ClaudeRunner;
556
591
  readStdin?: () => Promise<string>;
592
+ managedPaths?: readonly string[];
593
+ captureOverrides?: Partial<Parameters<typeof runCaptureCommand>[0]>;
557
594
  }
558
595
  declare function run(io: CliIO): Promise<number>;
559
596
 
@@ -656,6 +693,10 @@ interface SetupResult {
656
693
  readonly global: boolean;
657
694
  readonly captureContent: boolean;
658
695
  readonly resolvedEndpoint: string;
696
+ readonly sessionUpload: {
697
+ readonly hooksChanged: boolean;
698
+ readonly removedKeys: string[];
699
+ } | null;
659
700
  }
660
701
  declare function runSetup(params: SetupParams, io?: PersistIO): SetupResult;
661
702
 
package/dist/index.d.ts CHANGED
@@ -99,6 +99,7 @@ interface LoginEnv {
99
99
  readonly projectSlug?: string;
100
100
  readonly captureContent?: boolean;
101
101
  readonly global?: boolean;
102
+ readonly setup?: boolean;
102
103
  readonly host: string;
103
104
  readonly fetchFn?: FetchFn$1;
104
105
  readonly sleepFn?: SleepFn;
@@ -275,6 +276,7 @@ interface MapOptions {
275
276
  readonly captureContent: boolean;
276
277
  readonly scopeVersion?: string;
277
278
  readonly resolved?: ResolvedScrubbers | null;
279
+ readonly provenance?: "backfill" | "live";
278
280
  }
279
281
  declare function sessionToResourceSpans(session: ParsedSession, opts: MapOptions): BackfillResourceSpans;
280
282
 
@@ -420,6 +422,39 @@ declare function buildSpanTree(session: ParsedSession): SpanNode[];
420
422
 
421
423
  type FetchFn = typeof fetch;
422
424
 
425
+ interface StateIO {
426
+ readFile?: (p: string) => string;
427
+ writeFile?: (p: string, c: string, mode?: number) => void;
428
+ mkdir?: (p: string, mode: number) => void;
429
+ }
430
+
431
+ interface CaptureLogEntry {
432
+ readonly event?: string;
433
+ readonly session?: string;
434
+ readonly outcome: string;
435
+ readonly reason?: string;
436
+ readonly traces?: number;
437
+ readonly sent?: number;
438
+ readonly spans?: number;
439
+ readonly httpStatus?: number;
440
+ readonly project?: string;
441
+ }
442
+ interface CaptureContext {
443
+ readonly env: NodeJS.ProcessEnv;
444
+ readonly homeDir: string;
445
+ readonly endpointFlag?: string;
446
+ readonly readStdin?: () => Promise<string>;
447
+ readonly spawnWorker?: (payload: string) => void;
448
+ readonly armDeadline?: (ms: number) => void;
449
+ readonly sleep?: (ms: number) => Promise<void>;
450
+ readonly upload?: UploadDeps;
451
+ readonly stateIO?: StateIO;
452
+ readonly loginEnv?: Partial<LoginEnv>;
453
+ readonly managedPaths?: readonly string[];
454
+ readonly log?: (entry: CaptureLogEntry) => void;
455
+ }
456
+ declare function runCaptureCommand(ctx: CaptureContext): Promise<number>;
457
+
423
458
  declare const AGENTTRAIL_PROJECT_NS: "18a5d968-0fa2-5c8a-88da-0b29d80105d4";
424
459
  declare const AGENTTRAIL_AGENT_NS: "7f050af4-796e-5b05-94c2-dba78bcdc7c2";
425
460
  declare const AGENTTRAIL_INGEST_ENDPOINT: "https://ingest.agenttrail.sh";
@@ -554,6 +589,8 @@ interface CliIO {
554
589
  fetchFn?: FetchFn;
555
590
  pluginRunner?: ClaudeRunner;
556
591
  readStdin?: () => Promise<string>;
592
+ managedPaths?: readonly string[];
593
+ captureOverrides?: Partial<Parameters<typeof runCaptureCommand>[0]>;
557
594
  }
558
595
  declare function run(io: CliIO): Promise<number>;
559
596
 
@@ -656,6 +693,10 @@ interface SetupResult {
656
693
  readonly global: boolean;
657
694
  readonly captureContent: boolean;
658
695
  readonly resolvedEndpoint: string;
696
+ readonly sessionUpload: {
697
+ readonly hooksChanged: boolean;
698
+ readonly removedKeys: string[];
699
+ } | null;
659
700
  }
660
701
  declare function runSetup(params: SetupParams, io?: PersistIO): SetupResult;
661
702
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$,A as N,Aa as Ne,B as _,Ba as _e,C as x,Ca as xe,D as O,Da as Oe,E as h,F as G,G as k,H as v,I as D,J as U,K as F,L as b,M as j,N as B,O as M,P as w,Q as V,R as J,S as K,T as W,U as z,V as H,W as Q,X as q,Y as X,Z as Y,_ as Z,a as e,aa as ee,b as t,ba as te,c as o,ca as oe,d as r,da as re,e as n,ea as ne,f as p,fa as pe,g as i,ga as ie,h as s,ha as se,i as l,ia as le,j as a,ja as ae,k as u,ka as ue,l as c,la as ce,m as y,ma as ye,n as f,na as fe,o as S,oa as Se,p as d,pa as de,q as T,qa as Te,r as I,ra as Ie,s as m,sa as me,t as E,ta as Ee,u as R,ua as Re,v as C,va as Ce,w as g,wa as ge,x as A,xa as Ae,y as P,ya as Pe,z as L,za as Le}from"./chunk-WMGYTOQC.js";export{t as AGENTTRAIL_AGENT_NS,d as AGENTTRAIL_API_ENDPOINT,o as AGENTTRAIL_INGEST_ENDPOINT,Se as AGENTTRAIL_MARKETPLACE_NAME,Te as AGENTTRAIL_PLUGIN_ID,de as AGENTTRAIL_PLUGIN_NAME,e as AGENTTRAIL_PROJECT_NS,n as CLAUDE_CODE_VENDOR_SLUG,p as CONTENT_FLAGS,Ee as ClaudeCliNotFoundError,R as DEFAULT_LOCK_STALE_MS,Ie as MIN_CLAUDE_VERSION,P as PROJECT_CONFIG_FILE,Ce as PluginCommandError,Re as PluginUnsupportedError,$ as QuarantineError,j as REFRESH_STALE_WINDOW_MS,g as agenttrailConfigSchema,X as backfillSpanId,q as backfillTraceId,se as boundedPool,l as buildEnvBlock,s as buildResourceAttributes,Y as buildSpanTree,V as checkpointPath,S as clearCredentials,b as computeAgentId,F as computeProjectId,c as credentialsPath,me as defaultClaudeRunner,oe as defaultProjectsRoot,D as deriveProjectIdentity,U as deriveProjectSlug,i as encodeResourceValue,Pe as ensureClaudeSupportsPlugins,ce as ensureGitignored,ee as fileLineSource,_ as findGitRoot,N as findProjectConfig,L as globalConfigPath,Q as hashContent,H as hashFile,Ne as installAgentTrailPlugin,re as isSessionInProject,Ae as isVersionAtLeast,r as normalizeEndpoint,A as parseAgentTrailConfig,ge as parseClaudeVersion,k as parseGitRemote,te as parseSession,I as pollDeviceToken,y as readCredentials,v as readGitRemote,J as readState,m as refreshDeviceToken,h as resolveApiKey,O as resolveConfig,Le as resolvePluginScaffoldDir,x as resolveProjectRoot,E as revokeDeviceToken,Oe as run,ue as runImport,B as runLogin,w as runLogout,M as runRefresh,le as runScan,xe as runSetup,ae as runStatus,ne as scanTranscripts,Z as sessionToResourceSpans,a as settingsPath,z as shouldProcess,G as slugify,T as startDeviceAuth,pe as toOtlpJson,_e as uninstallAgentTrailPlugin,ie as uploadResourceSpans,W as upsertSession,C as withRefreshLock,ye as writeAgentTrailConfig,u as writeClaudeSettings,f as writeCredentials,fe as writeGlobalConfig,K as writeState};
1
+ import{$,A as N,Aa as Ne,B as _,Ba as _e,C as x,Ca as xe,D as O,Da as Oe,E as h,F as G,G as k,H as v,I as D,J as U,K as F,L as b,M as j,N as B,O as M,P as w,Q as V,R as J,S as K,T as W,U as z,V as H,W as Q,X as q,Y as X,Z as Y,_ as Z,a as e,aa as ee,b as t,ba as te,c as o,ca as oe,d as r,da as re,e as n,ea as ne,f as p,fa as pe,g as i,ga as ie,h as s,ha as se,i as l,ia as le,j as a,ja as ae,k as u,ka as ue,l as c,la as ce,m as y,ma as ye,n as f,na as fe,o as S,oa as Se,p as d,pa as de,q as T,qa as Te,r as I,ra as Ie,s as m,sa as me,t as E,ta as Ee,u as R,ua as Re,v as C,va as Ce,w as g,wa as ge,x as A,xa as Ae,y as P,ya as Pe,z as L,za as Le}from"./chunk-EFOSESFZ.js";export{t as AGENTTRAIL_AGENT_NS,d as AGENTTRAIL_API_ENDPOINT,o as AGENTTRAIL_INGEST_ENDPOINT,Se as AGENTTRAIL_MARKETPLACE_NAME,Te as AGENTTRAIL_PLUGIN_ID,de as AGENTTRAIL_PLUGIN_NAME,e as AGENTTRAIL_PROJECT_NS,n as CLAUDE_CODE_VENDOR_SLUG,p as CONTENT_FLAGS,Ee as ClaudeCliNotFoundError,R as DEFAULT_LOCK_STALE_MS,Ie as MIN_CLAUDE_VERSION,P as PROJECT_CONFIG_FILE,Ce as PluginCommandError,Re as PluginUnsupportedError,oe as QuarantineError,w as REFRESH_STALE_WINDOW_MS,g as agenttrailConfigSchema,$ as backfillSpanId,Z as backfillTraceId,ue as boundedPool,l as buildEnvBlock,s as buildResourceAttributes,ee as buildSpanTree,W as checkpointPath,S as clearCredentials,b as computeAgentId,F as computeProjectId,c as credentialsPath,me as defaultClaudeRunner,pe as defaultProjectsRoot,D as deriveProjectIdentity,U as deriveProjectSlug,i as encodeResourceValue,Pe as ensureClaudeSupportsPlugins,j as ensureGitignored,re as fileLineSource,_ as findGitRoot,N as findProjectConfig,L as globalConfigPath,Y as hashContent,X as hashFile,Ne as installAgentTrailPlugin,ie as isSessionInProject,Ae as isVersionAtLeast,r as normalizeEndpoint,A as parseAgentTrailConfig,ge as parseClaudeVersion,k as parseGitRemote,ne as parseSession,I as pollDeviceToken,y as readCredentials,v as readGitRemote,z as readState,m as refreshDeviceToken,h as resolveApiKey,O as resolveConfig,Le as resolvePluginScaffoldDir,x as resolveProjectRoot,E as revokeDeviceToken,Oe as run,fe as runImport,V as runLogin,K as runLogout,J as runRefresh,ce as runScan,xe as runSetup,ye as runStatus,se as scanTranscripts,te as sessionToResourceSpans,a as settingsPath,q as shouldProcess,G as slugify,T as startDeviceAuth,le as toOtlpJson,_e as uninstallAgentTrailPlugin,ae as uploadResourceSpans,Q as upsertSession,C as withRefreshLock,B as writeAgentTrailConfig,u as writeClaudeSettings,f as writeCredentials,M as writeGlobalConfig,H as writeState};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenttrail/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "The AgentTrail command-line tool: connects an AI coding agent's sessions to AgentTrail, with setup, sign-in, status and history import for the agent named by --agent.",
6
6
  "license": "Apache-2.0",
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "AgentTrail's plugin marketplace — the enforcement plugin for agent governance.",
9
- "version": "0.2.0"
9
+ "version": "0.2.2"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "agenttrail",
14
14
  "source": "./",
15
15
  "description": "AgentTrail enforcement plugin — PreToolUse governance hook (a fail-closed command shim).",
16
- "version": "0.2.0",
16
+ "version": "0.2.2",
17
17
  "author": {
18
18
  "name": "AgentTrail"
19
19
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agenttrail",
3
3
  "description": "AgentTrail enforcement plugin for Claude Code — carries the PreToolUse governance hook, a fail-closed command shim.",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "author": {
6
6
  "name": "AgentTrail",
7
7
  "url": "https://agenttrail.sh"