@ironbee-ai/cli 0.6.2 → 0.7.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/CHANGELOG.md +12 -0
- package/README.md +167 -39
- package/dist/analysis/code-changes.js.map +1 -1
- package/dist/analysis/cross-session.js.map +1 -1
- package/dist/analysis/fix-effectiveness.js.map +1 -1
- package/dist/analysis/time-analysis.js.map +1 -1
- package/dist/analysis/verdict-details.js.map +1 -1
- package/dist/analysis/verification-quality.js.map +1 -1
- package/dist/analytics/classifier.d.ts +99 -0
- package/dist/analytics/classifier.d.ts.map +1 -0
- package/dist/analytics/classifier.js +380 -0
- package/dist/analytics/classifier.js.map +1 -0
- package/dist/analytics/emit.d.ts +67 -0
- package/dist/analytics/emit.d.ts.map +1 -0
- package/dist/analytics/emit.js +901 -0
- package/dist/analytics/emit.js.map +1 -0
- package/dist/analytics/errors.d.ts +33 -0
- package/dist/analytics/errors.d.ts.map +1 -0
- package/dist/analytics/errors.js +93 -0
- package/dist/analytics/errors.js.map +1 -0
- package/dist/analytics/hook-trigger.d.ts +39 -0
- package/dist/analytics/hook-trigger.d.ts.map +1 -0
- package/dist/analytics/hook-trigger.js +127 -0
- package/dist/analytics/hook-trigger.js.map +1 -0
- package/dist/analytics/log.d.ts +44 -0
- package/dist/analytics/log.d.ts.map +1 -0
- package/dist/analytics/log.js +158 -0
- package/dist/analytics/log.js.map +1 -0
- package/dist/analytics/merge.d.ts +40 -0
- package/dist/analytics/merge.d.ts.map +1 -0
- package/dist/analytics/merge.js +527 -0
- package/dist/analytics/merge.js.map +1 -0
- package/dist/analytics/pricing.d.ts +149 -0
- package/dist/analytics/pricing.d.ts.map +1 -0
- package/dist/analytics/pricing.js +179 -0
- package/dist/analytics/pricing.js.map +1 -0
- package/dist/analytics/projection.d.ts +356 -0
- package/dist/analytics/projection.d.ts.map +1 -0
- package/dist/analytics/projection.js +2281 -0
- package/dist/analytics/projection.js.map +1 -0
- package/dist/analytics/spawn.d.ts +28 -0
- package/dist/analytics/spawn.d.ts.map +1 -0
- package/dist/analytics/spawn.js +57 -0
- package/dist/analytics/spawn.js.map +1 -0
- package/dist/analytics/state.d.ts +58 -0
- package/dist/analytics/state.d.ts.map +1 -0
- package/dist/analytics/state.js +329 -0
- package/dist/analytics/state.js.map +1 -0
- package/dist/analytics/transcript.d.ts +150 -0
- package/dist/analytics/transcript.d.ts.map +1 -0
- package/dist/analytics/transcript.js +276 -0
- package/dist/analytics/transcript.js.map +1 -0
- package/dist/analytics/types.d.ts +875 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics/types.js +31 -0
- package/dist/analytics/types.js.map +1 -0
- package/dist/clients/base.d.ts +21 -2
- package/dist/clients/base.d.ts.map +1 -1
- package/dist/clients/claude/commands/ironbee-verify.md +15 -7
- package/dist/clients/claude/fragments/command-verify.node.md +33 -0
- package/dist/clients/claude/fragments/rule.node.md +29 -0
- package/dist/clients/claude/fragments/skill.node.md +77 -0
- package/dist/clients/claude/hooks/activity-end.d.ts +13 -0
- package/dist/clients/claude/hooks/activity-end.d.ts.map +1 -0
- package/dist/clients/claude/hooks/activity-end.js +42 -0
- package/dist/clients/claude/hooks/activity-end.js.map +1 -0
- package/dist/clients/claude/hooks/require-verdict.d.ts +3 -2
- package/dist/clients/claude/hooks/require-verdict.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verdict.js +6 -5
- package/dist/clients/claude/hooks/require-verdict.js.map +1 -1
- package/dist/clients/claude/hooks/require-verification.d.ts +7 -4
- package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verification.js +44 -22
- package/dist/clients/claude/hooks/require-verification.js.map +1 -1
- package/dist/clients/claude/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-end.js +17 -2
- package/dist/clients/claude/hooks/session-end.js.map +1 -1
- package/dist/clients/claude/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-start.js +2 -1
- package/dist/clients/claude/hooks/session-start.js.map +1 -1
- package/dist/clients/claude/hooks/track-action-monitor.d.ts +27 -0
- package/dist/clients/claude/hooks/track-action-monitor.d.ts.map +1 -0
- package/dist/clients/claude/hooks/track-action-monitor.js +126 -0
- package/dist/clients/claude/hooks/track-action-monitor.js.map +1 -0
- package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/claude/hooks/track-action.js +29 -20
- package/dist/clients/claude/hooks/track-action.js.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.js +18 -1
- package/dist/clients/claude/hooks/verify-gate.js.map +1 -1
- package/dist/clients/claude/index.d.ts +4 -1
- package/dist/clients/claude/index.d.ts.map +1 -1
- package/dist/clients/claude/index.js +171 -94
- package/dist/clients/claude/index.js.map +1 -1
- package/dist/clients/claude/rules/ironbee-verification.md +41 -33
- package/dist/clients/claude/skills/ironbee-verification.md +93 -76
- package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +18 -10
- package/dist/clients/cursor/fragments/command-verify.node.md +33 -0
- package/dist/clients/cursor/fragments/rule.node.md +29 -0
- package/dist/clients/cursor/fragments/skill.node.md +77 -0
- package/dist/clients/cursor/hooks/activity-end.d.ts +14 -0
- package/dist/clients/cursor/hooks/activity-end.d.ts.map +1 -0
- package/dist/clients/cursor/hooks/activity-end.js +45 -0
- package/dist/clients/cursor/hooks/activity-end.js.map +1 -0
- package/dist/clients/cursor/hooks/require-verdict.d.ts +1 -1
- package/dist/clients/cursor/hooks/require-verdict.js +4 -4
- package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/require-verification.js +42 -16
- package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
- package/dist/clients/cursor/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-end.js +18 -2
- package/dist/clients/cursor/hooks/session-end.js.map +1 -1
- package/dist/clients/cursor/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-start.js +2 -1
- package/dist/clients/cursor/hooks/session-start.js.map +1 -1
- package/dist/clients/cursor/hooks/track-action-monitor.d.ts +27 -0
- package/dist/clients/cursor/hooks/track-action-monitor.d.ts.map +1 -0
- package/dist/clients/cursor/hooks/track-action-monitor.js +133 -0
- package/dist/clients/cursor/hooks/track-action-monitor.js.map +1 -0
- package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/track-action.js +51 -23
- package/dist/clients/cursor/hooks/track-action.js.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.js +14 -1
- package/dist/clients/cursor/hooks/verify-gate.js.map +1 -1
- package/dist/clients/cursor/index.d.ts +4 -1
- package/dist/clients/cursor/index.d.ts.map +1 -1
- package/dist/clients/cursor/index.js +117 -71
- package/dist/clients/cursor/index.js.map +1 -1
- package/dist/clients/cursor/rules/ironbee-verification.mdc +37 -29
- package/dist/clients/cursor/skills/ironbee-verification.md +93 -76
- package/dist/clients/registry.d.ts +14 -0
- package/dist/clients/registry.d.ts.map +1 -1
- package/dist/clients/registry.js +34 -0
- package/dist/clients/registry.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +40 -0
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/backend-toggle.d.ts +45 -0
- package/dist/commands/backend-toggle.d.ts.map +1 -0
- package/dist/commands/backend-toggle.js +192 -0
- package/dist/commands/backend-toggle.js.map +1 -0
- package/dist/commands/disable-backend.d.ts +14 -0
- package/dist/commands/disable-backend.d.ts.map +1 -0
- package/dist/commands/disable-backend.js +34 -0
- package/dist/commands/disable-backend.js.map +1 -0
- package/dist/commands/disable-verification.d.ts +16 -0
- package/dist/commands/disable-verification.d.ts.map +1 -0
- package/dist/commands/disable-verification.js +36 -0
- package/dist/commands/disable-verification.js.map +1 -0
- package/dist/commands/enable-backend.d.ts +15 -0
- package/dist/commands/enable-backend.d.ts.map +1 -0
- package/dist/commands/enable-backend.js +35 -0
- package/dist/commands/enable-backend.js.map +1 -0
- package/dist/commands/enable-verification.d.ts +14 -0
- package/dist/commands/enable-verification.d.ts.map +1 -0
- package/dist/commands/enable-verification.js +34 -0
- package/dist/commands/enable-verification.js.map +1 -0
- package/dist/commands/hook.d.ts.map +1 -1
- package/dist/commands/hook.js +60 -0
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/import.d.ts +39 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +369 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +15 -20
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/process-analytics.d.ts +18 -0
- package/dist/commands/process-analytics.d.ts.map +1 -0
- package/dist/commands/process-analytics.js +57 -0
- package/dist/commands/process-analytics.js.map +1 -0
- package/dist/commands/queue.d.ts +2 -3
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +2 -3
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +29 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verification-toggle.d.ts +47 -0
- package/dist/commands/verification-toggle.d.ts.map +1 -0
- package/dist/commands/verification-toggle.js +122 -0
- package/dist/commands/verification-toggle.js.map +1 -0
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +28 -0
- package/dist/commands/verify.js.map +1 -1
- package/dist/hooks/core/actions.d.ts +72 -70
- package/dist/hooks/core/actions.d.ts.map +1 -1
- package/dist/hooks/core/actions.js +191 -28
- package/dist/hooks/core/actions.js.map +1 -1
- package/dist/hooks/core/activity-end.d.ts +20 -0
- package/dist/hooks/core/activity-end.d.ts.map +1 -0
- package/dist/hooks/core/activity-end.js +23 -0
- package/dist/hooks/core/activity-end.js.map +1 -0
- package/dist/hooks/core/required-tools.d.ts +30 -0
- package/dist/hooks/core/required-tools.d.ts.map +1 -0
- package/dist/hooks/core/required-tools.js +70 -0
- package/dist/hooks/core/required-tools.js.map +1 -0
- package/dist/hooks/core/session-state.d.ts +12 -3
- package/dist/hooks/core/session-state.d.ts.map +1 -1
- package/dist/hooks/core/session-state.js +59 -0
- package/dist/hooks/core/session-state.js.map +1 -1
- package/dist/hooks/core/submit-verdict.d.ts.map +1 -1
- package/dist/hooks/core/submit-verdict.js +16 -12
- package/dist/hooks/core/submit-verdict.js.map +1 -1
- package/dist/hooks/core/verify-gate.d.ts +17 -3
- package/dist/hooks/core/verify-gate.d.ts.map +1 -1
- package/dist/hooks/core/verify-gate.js +312 -116
- package/dist/hooks/core/verify-gate.js.map +1 -1
- package/dist/import/claude/analytics-runner.d.ts +42 -0
- package/dist/import/claude/analytics-runner.d.ts.map +1 -0
- package/dist/import/claude/analytics-runner.js +213 -0
- package/dist/import/claude/analytics-runner.js.map +1 -0
- package/dist/import/claude/discovery.d.ts +22 -0
- package/dist/import/claude/discovery.d.ts.map +1 -0
- package/dist/import/claude/discovery.js +197 -0
- package/dist/import/claude/discovery.js.map +1 -0
- package/dist/import/claude/encoding.d.ts +50 -0
- package/dist/import/claude/encoding.d.ts.map +1 -0
- package/dist/import/claude/encoding.js +110 -0
- package/dist/import/claude/encoding.js.map +1 -0
- package/dist/import/claude/events/file-change.d.ts +28 -0
- package/dist/import/claude/events/file-change.d.ts.map +1 -0
- package/dist/import/claude/events/file-change.js +112 -0
- package/dist/import/claude/events/file-change.js.map +1 -0
- package/dist/import/claude/events/tool-call.d.ts +61 -0
- package/dist/import/claude/events/tool-call.d.ts.map +1 -0
- package/dist/import/claude/events/tool-call.js +119 -0
- package/dist/import/claude/events/tool-call.js.map +1 -0
- package/dist/import/claude/runner.d.ts +31 -0
- package/dist/import/claude/runner.d.ts.map +1 -0
- package/dist/import/claude/runner.js +280 -0
- package/dist/import/claude/runner.js.map +1 -0
- package/dist/import/claude/summary.d.ts +23 -0
- package/dist/import/claude/summary.d.ts.map +1 -0
- package/dist/import/claude/summary.js +186 -0
- package/dist/import/claude/summary.js.map +1 -0
- package/dist/import/claude/transcript-walk.d.ts +52 -0
- package/dist/import/claude/transcript-walk.d.ts.map +1 -0
- package/dist/import/claude/transcript-walk.js +187 -0
- package/dist/import/claude/transcript-walk.js.map +1 -0
- package/dist/import/concurrent-pool.d.ts +45 -0
- package/dist/import/concurrent-pool.d.ts.map +1 -0
- package/dist/import/concurrent-pool.js +95 -0
- package/dist/import/concurrent-pool.js.map +1 -0
- package/dist/import/emitter.d.ts +29 -0
- package/dist/import/emitter.d.ts.map +1 -0
- package/dist/import/emitter.js +66 -0
- package/dist/import/emitter.js.map +1 -0
- package/dist/import/events/activity.d.ts +23 -0
- package/dist/import/events/activity.d.ts.map +1 -0
- package/dist/import/events/activity.js +45 -0
- package/dist/import/events/activity.js.map +1 -0
- package/dist/import/events/session.d.ts +24 -0
- package/dist/import/events/session.d.ts.map +1 -0
- package/dist/import/events/session.js +47 -0
- package/dist/import/events/session.js.map +1 -0
- package/dist/import/filter.d.ts +47 -0
- package/dist/import/filter.d.ts.map +1 -0
- package/dist/import/filter.js +90 -0
- package/dist/import/filter.js.map +1 -0
- package/dist/import/ids.d.ts +56 -0
- package/dist/import/ids.d.ts.map +1 -0
- package/dist/import/ids.js +87 -0
- package/dist/import/ids.js.map +1 -0
- package/dist/import/index.d.ts +29 -0
- package/dist/import/index.d.ts.map +1 -0
- package/dist/import/index.js +52 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/marker.d.ts +20 -0
- package/dist/import/marker.d.ts.map +1 -0
- package/dist/import/marker.js +71 -0
- package/dist/import/marker.js.map +1 -0
- package/dist/import/pipeline.d.ts +41 -0
- package/dist/import/pipeline.d.ts.map +1 -0
- package/dist/import/pipeline.js +47 -0
- package/dist/import/pipeline.js.map +1 -0
- package/dist/import/progress.d.ts +20 -0
- package/dist/import/progress.d.ts.map +1 -0
- package/dist/import/progress.js +69 -0
- package/dist/import/progress.js.map +1 -0
- package/dist/import/skip.d.ts +13 -0
- package/dist/import/skip.d.ts.map +1 -0
- package/dist/import/skip.js +24 -0
- package/dist/import/skip.js.map +1 -0
- package/dist/import/types.d.ts +125 -0
- package/dist/import/types.d.ts.map +1 -0
- package/dist/import/types.js +28 -0
- package/dist/import/types.js.map +1 -0
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/collector.d.ts +29 -3
- package/dist/lib/collector.d.ts.map +1 -1
- package/dist/lib/collector.js +118 -8
- package/dist/lib/collector.js.map +1 -1
- package/dist/lib/config.d.ts +240 -83
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +482 -89
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/event.d.ts +72 -0
- package/dist/lib/event.d.ts.map +1 -0
- package/dist/lib/event.js +42 -0
- package/dist/lib/event.js.map +1 -0
- package/dist/lib/gitignore.d.ts +21 -0
- package/dist/lib/gitignore.d.ts.map +1 -0
- package/dist/lib/gitignore.js +54 -0
- package/dist/lib/gitignore.js.map +1 -0
- package/dist/lib/runtime-section.d.ts +118 -0
- package/dist/lib/runtime-section.d.ts.map +1 -0
- package/dist/lib/runtime-section.js +256 -0
- package/dist/lib/runtime-section.js.map +1 -0
- package/dist/lib/telemetry.d.ts +1 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +4 -1
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/queue/dead-letter.d.ts +5 -1
- package/dist/queue/dead-letter.d.ts.map +1 -1
- package/dist/queue/dead-letter.js +5 -1
- package/dist/queue/dead-letter.js.map +1 -1
- package/dist/queue/drain.d.ts +3 -2
- package/dist/queue/drain.d.ts.map +1 -1
- package/dist/queue/drain.js +3 -2
- package/dist/queue/drain.js.map +1 -1
- package/dist/queue/flush.d.ts +28 -12
- package/dist/queue/flush.d.ts.map +1 -1
- package/dist/queue/flush.js +43 -18
- package/dist/queue/flush.js.map +1 -1
- package/dist/queue/handlers/send-event.d.ts.map +1 -1
- package/dist/queue/handlers/send-event.js.map +1 -1
- package/dist/queue/index.d.ts +1 -2
- package/dist/queue/index.d.ts.map +1 -1
- package/dist/queue/index.js +2 -2
- package/dist/queue/index.js.map +1 -1
- package/dist/queue/paths.d.ts +4 -2
- package/dist/queue/paths.d.ts.map +1 -1
- package/dist/queue/paths.js +4 -2
- package/dist/queue/paths.js.map +1 -1
- package/dist/queue/process-file.d.ts +5 -1
- package/dist/queue/process-file.d.ts.map +1 -1
- package/dist/queue/process-file.js +5 -1
- package/dist/queue/process-file.js.map +1 -1
- package/dist/queue/snapshot.d.ts +4 -1
- package/dist/queue/snapshot.d.ts.map +1 -1
- package/dist/queue/snapshot.js +4 -1
- package/dist/queue/snapshot.js.map +1 -1
- package/dist/queue/spawn.d.ts +1 -3
- package/dist/queue/spawn.d.ts.map +1 -1
- package/dist/queue/spawn.js +1 -3
- package/dist/queue/spawn.js.map +1 -1
- package/dist/queue/submit.d.ts +6 -1
- package/dist/queue/submit.d.ts.map +1 -1
- package/dist/queue/submit.js +6 -1
- package/dist/queue/submit.js.map +1 -1
- package/dist/queue/types.d.ts +5 -1
- package/dist/queue/types.d.ts.map +1 -1
- package/dist/queue/types.js +5 -1
- package/dist/queue/types.js.map +1 -1
- package/dist/queue/worker-log.d.ts +3 -1
- package/dist/queue/worker-log.d.ts.map +1 -1
- package/dist/queue/worker-log.js +3 -1
- package/dist/queue/worker-log.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,48 +2,30 @@
|
|
|
2
2
|
* IronBee — Session Action Logger
|
|
3
3
|
*
|
|
4
4
|
* Appends typed events to .ironbee/sessions/{sessionId}/actions.jsonl
|
|
5
|
-
* Event types: session_start,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* blocking raw string literal assignments (e.g. in tests).
|
|
5
|
+
* and forwards them to the collector. Event types: session_start,
|
|
6
|
+
* tool_call, verification_requested, session_analytics, etc.
|
|
7
|
+
*
|
|
8
|
+
* Base event shape lives in `src/lib/event.ts`; this module composes
|
|
9
|
+
* the per-event-type payloads + handles persistence.
|
|
11
10
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readonly SESSION_END: "session_end";
|
|
15
|
-
readonly ACTIVITY_START: "activity_start";
|
|
16
|
-
readonly ACTIVITY_END: "activity_end";
|
|
17
|
-
readonly VERIFICATION_START: "verification_start";
|
|
18
|
-
readonly VERIFICATION_END: "verification_end";
|
|
19
|
-
readonly VERIFICATION_REQUESTED: "verification_requested";
|
|
20
|
-
readonly VERDICT_WRITE: "verdict_write";
|
|
21
|
-
readonly FIX_START: "fix_start";
|
|
22
|
-
readonly FIX_END: "fix_end";
|
|
23
|
-
readonly FILE_CHANGE: "file_change";
|
|
24
|
-
readonly TOOL_CALL: "tool_call";
|
|
25
|
-
};
|
|
26
|
-
export type EventTypeValue = typeof EventType[keyof typeof EventType];
|
|
27
|
-
export interface ActionEntry {
|
|
28
|
-
id: string;
|
|
29
|
-
type: EventTypeValue;
|
|
30
|
-
timestamp: number;
|
|
31
|
-
session_id: string;
|
|
32
|
-
project_name: string;
|
|
33
|
-
user_email?: string;
|
|
34
|
-
[key: string]: unknown;
|
|
35
|
-
}
|
|
11
|
+
import { ActivityAwareEvent, Event, EventType, EventTypeValue, FixAwareEvent, VerificationAwareEvent } from "../../lib/event";
|
|
12
|
+
export { Event, EventType, EventTypeValue, ActivityAwareEvent, VerificationAwareEvent, FixAwareEvent };
|
|
36
13
|
/**
|
|
37
14
|
* Resolve project name by walking up from the given directory looking for a
|
|
38
|
-
* `.git` entry (directory or file — the latter covers worktrees).
|
|
39
|
-
*
|
|
40
|
-
*
|
|
15
|
+
* `.git` entry (directory or file — the latter covers worktrees / submodules).
|
|
16
|
+
*
|
|
17
|
+
* When a git root is found we prefer the **repo name parsed from the remote
|
|
18
|
+
* URL** (origin → first remote in `.git/config`) so that two clones of the
|
|
19
|
+
* same repo produce the same `project_name` regardless of how the user named
|
|
20
|
+
* the local folder. Fallback chain when the URL can't be derived:
|
|
21
|
+
* 1. basename of the git root (legacy behavior)
|
|
22
|
+
* 2. basename of the starting directory (when no `.git` was found at all)
|
|
41
23
|
*/
|
|
42
24
|
export declare function resolveProjectName(startDir: string): string;
|
|
43
25
|
/**
|
|
44
26
|
* Base fields that every event must carry — derived from the actionsFile path.
|
|
45
27
|
* Writers spread this into concrete event constructions to satisfy the strict
|
|
46
|
-
* `
|
|
28
|
+
* `Event` contract without duplicating derivation logic.
|
|
47
29
|
*
|
|
48
30
|
* `user_email` is read from the per-session `state.json` (populated once at
|
|
49
31
|
* session start). If state.json is absent or the field is unset, it is
|
|
@@ -56,29 +38,14 @@ export declare function baseFields(actionsFile: string): {
|
|
|
56
38
|
user_email?: string;
|
|
57
39
|
};
|
|
58
40
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* VerificationAware and FixAware extend ActivityAware — a verification or fix
|
|
62
|
-
* cycle is always part of an activity turn.
|
|
63
|
-
*/
|
|
64
|
-
export interface ActivityAwareActionEntry extends ActionEntry {
|
|
65
|
-
activity_id: string;
|
|
66
|
-
}
|
|
67
|
-
export interface VerificationAwareActionEntry extends ActivityAwareActionEntry {
|
|
68
|
-
verification_id: string;
|
|
69
|
-
}
|
|
70
|
-
export interface FixAwareActionEntry extends ActivityAwareActionEntry {
|
|
71
|
-
fix_id: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A tool_call event. Extends ActivityAwareActionEntry (activity is always
|
|
75
|
-
* known when a tool runs) but NOT VerificationAwareActionEntry — tool calls
|
|
41
|
+
* A tool_call event. Extends ActivityAwareEvent (activity is always
|
|
42
|
+
* known when a tool runs) but NOT VerificationAwareEvent — tool calls
|
|
76
43
|
* happen everywhere in a session, most of them outside verification cycles
|
|
77
44
|
* (Bash / Edit / Read fire any time the agent wants, whereas verification
|
|
78
45
|
* cycles are bounded windows explicitly opened by the agent). Downstream
|
|
79
46
|
* schema must therefore treat `verification_id` and `trace_id` as optional.
|
|
80
47
|
*/
|
|
81
|
-
export interface ToolCallAction extends
|
|
48
|
+
export interface ToolCallAction extends ActivityAwareEvent {
|
|
82
49
|
type: "tool_call";
|
|
83
50
|
/**
|
|
84
51
|
* Canonical tool identity after classification:
|
|
@@ -137,32 +104,66 @@ export interface ToolCallAction extends ActivityAwareActionEntry {
|
|
|
137
104
|
duration?: number | null;
|
|
138
105
|
error?: string;
|
|
139
106
|
}
|
|
140
|
-
export interface VerificationRequestedAction extends
|
|
107
|
+
export interface VerificationRequestedAction extends ActivityAwareEvent {
|
|
141
108
|
type: "verification_requested";
|
|
142
109
|
action: "allow" | "block";
|
|
143
110
|
reason: string;
|
|
111
|
+
/**
|
|
112
|
+
* Active cycles for this gate run — registered cycle names like
|
|
113
|
+
* `"browser"`, `"node"`, plus future runtimes. Open string[] (not literal
|
|
114
|
+
* union) so adding a runtime never changes the wire type.
|
|
115
|
+
* Optional — older entries pre-multi-cycle may not carry it.
|
|
116
|
+
*/
|
|
117
|
+
modes?: string[];
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Per-probe reference inside `Verdict.backend_node_probes_set`.
|
|
121
|
+
*
|
|
122
|
+
* - `tracepoint` / `logpoint`: `location` is `"<file>:<line>"`.
|
|
123
|
+
* - `exceptionpoint`: `location` is the exception state ("uncaught" or "all").
|
|
124
|
+
* - `triggered`: at least one snapshot collected for this probe during the cycle.
|
|
125
|
+
*/
|
|
126
|
+
export interface NodeProbeRef {
|
|
127
|
+
type: "tracepoint" | "logpoint" | "exceptionpoint";
|
|
128
|
+
location: string;
|
|
129
|
+
triggered: boolean;
|
|
144
130
|
}
|
|
145
131
|
/**
|
|
146
132
|
* Verdict payload recorded inside VerdictWriteAction.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
133
|
+
*
|
|
134
|
+
* Browser-cycle fields (`pages_tested`, `console_errors`, `network_failures`)
|
|
135
|
+
* are populated when the browser cycle is active. Node-cycle fields
|
|
136
|
+
* (`backend_node_*`) are populated when the node cycle is active. Multi-mode
|
|
137
|
+
* verdicts populate the relevant fields for every active cycle. `checks` and
|
|
138
|
+
* `status` are shared across cycles.
|
|
139
|
+
*
|
|
140
|
+
* `console_errors` / `network_failures` carry counts (numbers) for backwards
|
|
141
|
+
* compatibility with the pre-multi-cycle wire — agents can keep submitting
|
|
142
|
+
* the same shape they do today for browser-only sessions.
|
|
149
143
|
*/
|
|
150
144
|
export interface Verdict {
|
|
145
|
+
/** "pass" | "fail" | "unknown" — kept as `string` for forward tolerance. */
|
|
151
146
|
status: string;
|
|
152
|
-
pages_tested: string[];
|
|
153
147
|
checks: string[];
|
|
154
|
-
console_errors?: number;
|
|
155
|
-
network_failures?: number;
|
|
156
148
|
issues?: string[];
|
|
157
149
|
fixes?: string[];
|
|
158
|
-
|
|
159
|
-
|
|
150
|
+
pages_tested?: string[];
|
|
151
|
+
console_errors?: number;
|
|
152
|
+
network_failures?: number;
|
|
153
|
+
backend_node_processes_connected?: string[];
|
|
154
|
+
backend_node_probes_set?: NodeProbeRef[];
|
|
155
|
+
/** Total snapshots collected across all probes (a single probe can fire many times). */
|
|
156
|
+
backend_node_probe_snapshots_collected?: number;
|
|
157
|
+
/** Error-level log lines from `ndt_debug_get-logs` (agent-filtered). */
|
|
158
|
+
backend_node_log_errors?: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface VerdictWriteAction extends VerificationAwareEvent {
|
|
160
161
|
type: "verdict_write";
|
|
161
162
|
trace_id?: string;
|
|
162
163
|
verdict: Verdict;
|
|
163
164
|
}
|
|
164
165
|
export type FileChangeOperation = "create" | "update" | "delete";
|
|
165
|
-
export interface FileChangeAction extends
|
|
166
|
+
export interface FileChangeAction extends FixAwareEvent {
|
|
166
167
|
type: "file_change";
|
|
167
168
|
tool_name: string;
|
|
168
169
|
file_path: string;
|
|
@@ -176,40 +177,40 @@ export interface FileChangeAction extends FixAwareActionEntry {
|
|
|
176
177
|
/** Lines removed by this change. `null` when unknown — see `lines_added`. */
|
|
177
178
|
lines_removed: number | null;
|
|
178
179
|
}
|
|
179
|
-
export interface SessionStartAction extends
|
|
180
|
+
export interface SessionStartAction extends Event {
|
|
180
181
|
type: "session_start";
|
|
181
182
|
source: string;
|
|
182
183
|
client?: string;
|
|
183
184
|
}
|
|
184
|
-
export interface SessionEndAction extends
|
|
185
|
+
export interface SessionEndAction extends Event {
|
|
185
186
|
type: "session_end";
|
|
186
187
|
duration?: number;
|
|
187
188
|
reason?: string;
|
|
188
189
|
}
|
|
189
|
-
export interface VerificationStartAction extends
|
|
190
|
+
export interface VerificationStartAction extends VerificationAwareEvent {
|
|
190
191
|
type: "verification_start";
|
|
191
192
|
trace_id: string;
|
|
192
193
|
}
|
|
193
|
-
export interface VerificationEndAction extends
|
|
194
|
+
export interface VerificationEndAction extends VerificationAwareEvent {
|
|
194
195
|
type: "verification_end";
|
|
195
196
|
trace_id: string;
|
|
196
197
|
duration?: number;
|
|
197
198
|
status?: string;
|
|
198
199
|
reason?: string;
|
|
199
200
|
}
|
|
200
|
-
export interface FixStartAction extends
|
|
201
|
+
export interface FixStartAction extends FixAwareEvent {
|
|
201
202
|
type: "fix_start";
|
|
202
203
|
}
|
|
203
|
-
export interface FixEndAction extends
|
|
204
|
+
export interface FixEndAction extends FixAwareEvent {
|
|
204
205
|
type: "fix_end";
|
|
205
206
|
duration?: number;
|
|
206
207
|
reason?: string;
|
|
207
208
|
}
|
|
208
|
-
export interface ActivityStartAction extends
|
|
209
|
+
export interface ActivityStartAction extends ActivityAwareEvent {
|
|
209
210
|
type: "activity_start";
|
|
210
211
|
source?: string;
|
|
211
212
|
}
|
|
212
|
-
export interface ActivityEndAction extends
|
|
213
|
+
export interface ActivityEndAction extends ActivityAwareEvent {
|
|
213
214
|
type: "activity_end";
|
|
214
215
|
duration?: number;
|
|
215
216
|
reason?: string;
|
|
@@ -228,9 +229,10 @@ export declare function appendAction(actionsFile: string, entry: AppendActionInp
|
|
|
228
229
|
* duration from its timestamp to now.
|
|
229
230
|
*/
|
|
230
231
|
export declare function findDurationSinceLastAction(actionsFile: string, actionType: string, now: number): number | undefined;
|
|
231
|
-
export declare function readActionsSinceLastMarker(actionsFile: string, markerType: string):
|
|
232
|
+
export declare function readActionsSinceLastMarker(actionsFile: string, markerType: string): Event[];
|
|
232
233
|
export declare function getToolCallsSinceLastVerification(actionsFile: string): ToolCallAction[];
|
|
233
234
|
export declare function getToolCallsSinceLastFileChange(actionsFile: string): ToolCallAction[];
|
|
234
235
|
export declare function hasToolCallsSinceLastVerdict(actionsFile: string): boolean;
|
|
235
236
|
export declare function hasFileChangesSinceLastVerification(actionsFile: string): boolean;
|
|
237
|
+
export declare function getFileChangesSinceLastVerification(actionsFile: string): FileChangeAction[];
|
|
236
238
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/hooks/core/actions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/hooks/core/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EACH,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,sBAAsB,EACzB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,aAAa,EAAE,CAAC;AAEvG;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkB3D;AA8ID;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAiBA;AAED;;;;;;;GAOG;AAC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GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAwBpH;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAE3F;AAqDD,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAGvF;AAED,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAGrF;AAED,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGzE;AAED,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGhF;AAED,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAG3F"}
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
* IronBee — Session Action Logger
|
|
4
4
|
*
|
|
5
5
|
* Appends typed events to .ironbee/sessions/{sessionId}/actions.jsonl
|
|
6
|
-
* Event types: session_start,
|
|
6
|
+
* and forwards them to the collector. Event types: session_start,
|
|
7
|
+
* tool_call, verification_requested, session_analytics, etc.
|
|
8
|
+
*
|
|
9
|
+
* Base event shape lives in `src/lib/event.ts`; this module composes
|
|
10
|
+
* the per-event-type payloads + handles persistence.
|
|
7
11
|
*/
|
|
8
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
13
|
exports.EventType = void 0;
|
|
@@ -16,40 +20,34 @@ exports.getToolCallsSinceLastVerification = getToolCallsSinceLastVerification;
|
|
|
16
20
|
exports.getToolCallsSinceLastFileChange = getToolCallsSinceLastFileChange;
|
|
17
21
|
exports.hasToolCallsSinceLastVerdict = hasToolCallsSinceLastVerdict;
|
|
18
22
|
exports.hasFileChangesSinceLastVerification = hasFileChangesSinceLastVerification;
|
|
23
|
+
exports.getFileChangesSinceLastVerification = getFileChangesSinceLastVerification;
|
|
19
24
|
const fs_1 = require("fs");
|
|
20
25
|
const crypto_1 = require("crypto");
|
|
21
26
|
const path_1 = require("path");
|
|
22
27
|
const logger_1 = require("../../lib/logger");
|
|
23
28
|
const collector_1 = require("../../lib/collector");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Using a const object + union type gives enum-like ergonomics without
|
|
27
|
-
* blocking raw string literal assignments (e.g. in tests).
|
|
28
|
-
*/
|
|
29
|
-
exports.EventType = {
|
|
30
|
-
SESSION_START: "session_start",
|
|
31
|
-
SESSION_END: "session_end",
|
|
32
|
-
ACTIVITY_START: "activity_start",
|
|
33
|
-
ACTIVITY_END: "activity_end",
|
|
34
|
-
VERIFICATION_START: "verification_start",
|
|
35
|
-
VERIFICATION_END: "verification_end",
|
|
36
|
-
VERIFICATION_REQUESTED: "verification_requested",
|
|
37
|
-
VERDICT_WRITE: "verdict_write",
|
|
38
|
-
FIX_START: "fix_start",
|
|
39
|
-
FIX_END: "fix_end",
|
|
40
|
-
FILE_CHANGE: "file_change",
|
|
41
|
-
TOOL_CALL: "tool_call",
|
|
42
|
-
};
|
|
29
|
+
const event_1 = require("../../lib/event");
|
|
30
|
+
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return event_1.EventType; } });
|
|
43
31
|
/**
|
|
44
32
|
* Resolve project name by walking up from the given directory looking for a
|
|
45
|
-
* `.git` entry (directory or file — the latter covers worktrees).
|
|
46
|
-
*
|
|
47
|
-
*
|
|
33
|
+
* `.git` entry (directory or file — the latter covers worktrees / submodules).
|
|
34
|
+
*
|
|
35
|
+
* When a git root is found we prefer the **repo name parsed from the remote
|
|
36
|
+
* URL** (origin → first remote in `.git/config`) so that two clones of the
|
|
37
|
+
* same repo produce the same `project_name` regardless of how the user named
|
|
38
|
+
* the local folder. Fallback chain when the URL can't be derived:
|
|
39
|
+
* 1. basename of the git root (legacy behavior)
|
|
40
|
+
* 2. basename of the starting directory (when no `.git` was found at all)
|
|
48
41
|
*/
|
|
49
42
|
function resolveProjectName(startDir) {
|
|
50
43
|
let current = startDir;
|
|
51
44
|
while (true) {
|
|
52
|
-
|
|
45
|
+
const gitEntry = (0, path_1.join)(current, ".git");
|
|
46
|
+
if ((0, fs_1.existsSync)(gitEntry)) {
|
|
47
|
+
const fromRemote = repoNameFromGitDir(gitEntry);
|
|
48
|
+
if (fromRemote) {
|
|
49
|
+
return fromRemote;
|
|
50
|
+
}
|
|
53
51
|
return (0, path_1.basename)(current);
|
|
54
52
|
}
|
|
55
53
|
const parent = (0, path_1.dirname)(current);
|
|
@@ -60,10 +58,148 @@ function resolveProjectName(startDir) {
|
|
|
60
58
|
}
|
|
61
59
|
return (0, path_1.basename)(startDir);
|
|
62
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Given the path of a `.git` entry (directory in the normal case, file in
|
|
63
|
+
* the worktree / submodule case), read its `config` and return the repo name
|
|
64
|
+
* derived from the first remote URL we find. Prefers `[remote "origin"]`
|
|
65
|
+
* but falls back to any other remote when origin is absent.
|
|
66
|
+
*
|
|
67
|
+
* Returns `undefined` on any failure (no remote, malformed config, I/O
|
|
68
|
+
* error, missing file). Callers fall back to folder basename.
|
|
69
|
+
*/
|
|
70
|
+
function repoNameFromGitDir(gitEntry) {
|
|
71
|
+
try {
|
|
72
|
+
const gitDir = resolveGitDir(gitEntry);
|
|
73
|
+
if (!gitDir) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const configPath = (0, path_1.join)(gitDir, "config");
|
|
77
|
+
if (!(0, fs_1.existsSync)(configPath)) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const url = readFirstRemoteUrl((0, fs_1.readFileSync)(configPath, "utf-8"));
|
|
81
|
+
if (!url) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
return repoNameFromRemoteUrl(url);
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
logger_1.logger.debug(`resolveProjectName: failed to read git config at ${gitEntry}: ${e instanceof Error ? e.message : e}`);
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resolve `.git` (directory or worktree pointer file) to the actual gitdir
|
|
93
|
+
* containing `config`. For a worktree the `.git` file looks like:
|
|
94
|
+
* `gitdir: /abs/path/to/main-repo/.git/worktrees/<name>`
|
|
95
|
+
* That worktree dir has a `config.worktree` for per-worktree overrides but
|
|
96
|
+
* the canonical `[remote …]` section lives in the main repo's `.git/config`,
|
|
97
|
+
* which we reach via the worktree's `commondir` file.
|
|
98
|
+
*/
|
|
99
|
+
function resolveGitDir(gitEntry) {
|
|
100
|
+
const st = (0, fs_1.statSync)(gitEntry);
|
|
101
|
+
if (st.isDirectory()) {
|
|
102
|
+
return gitEntry;
|
|
103
|
+
}
|
|
104
|
+
if (!st.isFile()) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
const contents = (0, fs_1.readFileSync)(gitEntry, "utf-8").trim();
|
|
108
|
+
const match = contents.match(/^gitdir:\s*(.+)$/m);
|
|
109
|
+
if (!match) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const raw = match[1].trim();
|
|
113
|
+
const pointed = (0, path_1.isAbsolute)(raw) ? raw : (0, path_1.resolve)((0, path_1.dirname)(gitEntry), raw);
|
|
114
|
+
// Worktrees: `commondir` points to the main `.git` dir (where `config` lives).
|
|
115
|
+
const commondirFile = (0, path_1.join)(pointed, "commondir");
|
|
116
|
+
if ((0, fs_1.existsSync)(commondirFile)) {
|
|
117
|
+
const commonRaw = (0, fs_1.readFileSync)(commondirFile, "utf-8").trim();
|
|
118
|
+
return (0, path_1.isAbsolute)(commonRaw) ? commonRaw : (0, path_1.resolve)(pointed, commonRaw);
|
|
119
|
+
}
|
|
120
|
+
return pointed;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Parse a git config file body and return the URL of `[remote "origin"]`
|
|
124
|
+
* if present, otherwise the URL of the first `[remote "*"]` section.
|
|
125
|
+
*
|
|
126
|
+
* Hand-rolled because git config is INI-ish but with quoted subsection
|
|
127
|
+
* names. We don't handle `\n` line continuations or escaped quotes — git
|
|
128
|
+
* itself doesn't write those for remote URLs in practice.
|
|
129
|
+
*/
|
|
130
|
+
function readFirstRemoteUrl(config) {
|
|
131
|
+
const lines = config.split(/\r?\n/);
|
|
132
|
+
let currentSection = null;
|
|
133
|
+
let currentSubsection = null;
|
|
134
|
+
let originUrl;
|
|
135
|
+
let firstUrl;
|
|
136
|
+
for (const rawLine of lines) {
|
|
137
|
+
const line = rawLine.trim();
|
|
138
|
+
if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const sectionMatch = line.match(/^\[([^\s\]]+)(?:\s+"([^"]*)")?\]$/);
|
|
142
|
+
if (sectionMatch) {
|
|
143
|
+
currentSection = sectionMatch[1].toLowerCase();
|
|
144
|
+
currentSubsection = sectionMatch[2] ?? null;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (currentSection !== "remote" || currentSubsection === null) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const kvMatch = line.match(/^url\s*=\s*(.+?)\s*$/i);
|
|
151
|
+
if (!kvMatch) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const url = kvMatch[1];
|
|
155
|
+
if (currentSubsection === "origin") {
|
|
156
|
+
originUrl = url;
|
|
157
|
+
}
|
|
158
|
+
if (firstUrl === undefined) {
|
|
159
|
+
firstUrl = url;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return originUrl ?? firstUrl;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Extract the repo name from a remote URL.
|
|
166
|
+
* `https://github.com/foo/bar.git` → `bar`
|
|
167
|
+
* `git@github.com:foo/bar.git` → `bar`
|
|
168
|
+
* `https://gitlab.com/grp/sub/baz` → `baz`
|
|
169
|
+
* `ssh://git@host/foo/bar/` → `bar`
|
|
170
|
+
*
|
|
171
|
+
* Returns `undefined` if no plausible name can be extracted (empty path,
|
|
172
|
+
* URL ending in just a host).
|
|
173
|
+
*/
|
|
174
|
+
function repoNameFromRemoteUrl(url) {
|
|
175
|
+
let cleaned = url.trim();
|
|
176
|
+
if (cleaned.length === 0) {
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
// SCP-style `git@host:path` → normalize to `host/path` so the path-tail
|
|
180
|
+
// logic below works uniformly. We don't actually need the host.
|
|
181
|
+
const scpMatch = cleaned.match(/^[^/@]+@[^/:]+:(.+)$/);
|
|
182
|
+
if (scpMatch) {
|
|
183
|
+
cleaned = scpMatch[1];
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
// Strip scheme (`https://`, `ssh://`, `git://`, `file://`, …) and the
|
|
187
|
+
// host segment that follows it.
|
|
188
|
+
cleaned = cleaned.replace(/^[a-z][a-z0-9+.-]*:\/\/[^/]*\//i, "");
|
|
189
|
+
}
|
|
190
|
+
// Strip query / fragment, trailing slashes.
|
|
191
|
+
cleaned = cleaned.replace(/[?#].*$/, "").replace(/\/+$/, "");
|
|
192
|
+
if (cleaned.length === 0) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
const tail = cleaned.split("/").pop() ?? "";
|
|
196
|
+
const stripped = tail.replace(/\.git$/i, "");
|
|
197
|
+
return stripped.length > 0 ? stripped : undefined;
|
|
198
|
+
}
|
|
63
199
|
/**
|
|
64
200
|
* Base fields that every event must carry — derived from the actionsFile path.
|
|
65
201
|
* Writers spread this into concrete event constructions to satisfy the strict
|
|
66
|
-
* `
|
|
202
|
+
* `Event` contract without duplicating derivation logic.
|
|
67
203
|
*
|
|
68
204
|
* `user_email` is read from the per-session `state.json` (populated once at
|
|
69
205
|
* session start). If state.json is absent or the field is unset, it is
|
|
@@ -113,6 +249,7 @@ async function appendAction(actionsFile, entry) {
|
|
|
113
249
|
// actionsFile: {projectDir}/.ironbee/sessions/{sessionId}/actions.jsonl
|
|
114
250
|
const sessionId = (0, path_1.basename)((0, path_1.dirname)(actionsFile));
|
|
115
251
|
const projectDir = (0, path_1.dirname)((0, path_1.dirname)((0, path_1.dirname)((0, path_1.dirname)(actionsFile))));
|
|
252
|
+
// Safe cast: we just enriched id/session_id/project_name above.
|
|
116
253
|
await (0, collector_1.sendToCollector)(entry, sessionId, projectDir);
|
|
117
254
|
}
|
|
118
255
|
catch (e) {
|
|
@@ -149,6 +286,13 @@ function findDurationSinceLastAction(actionsFile, actionType, now) {
|
|
|
149
286
|
return undefined;
|
|
150
287
|
}
|
|
151
288
|
function readActionsSinceLastMarker(actionsFile, markerType) {
|
|
289
|
+
return readActionsSinceMatch(actionsFile, (e) => e.type === markerType);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Read all actions after the most recent entry matching `predicate`.
|
|
293
|
+
* Returns every entry when no match is found.
|
|
294
|
+
*/
|
|
295
|
+
function readActionsSinceMatch(actionsFile, predicate) {
|
|
152
296
|
if (!(0, fs_1.existsSync)(actionsFile)) {
|
|
153
297
|
return [];
|
|
154
298
|
}
|
|
@@ -161,7 +305,7 @@ function readActionsSinceLastMarker(actionsFile, markerType) {
|
|
|
161
305
|
try {
|
|
162
306
|
const entry = JSON.parse(lines[i]);
|
|
163
307
|
entries.push(entry);
|
|
164
|
-
if (entry
|
|
308
|
+
if (predicate(entry)) {
|
|
165
309
|
lastMarkerIndex = i;
|
|
166
310
|
}
|
|
167
311
|
}
|
|
@@ -176,8 +320,23 @@ function readActionsSinceLastMarker(actionsFile, markerType) {
|
|
|
176
320
|
return [];
|
|
177
321
|
}
|
|
178
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Block markers (`action: "block"`) are **transparent** to the verification
|
|
325
|
+
* scope — they don't reset what the gate is asked to verify. Only `allow`
|
|
326
|
+
* markers reset the boundary, since they record that the gate signed off on
|
|
327
|
+
* everything before them.
|
|
328
|
+
*
|
|
329
|
+
* Without this, a "blocked then no further tracked edits" loop would let the
|
|
330
|
+
* agent submit any verdict on the next Stop and skate past with `no_edits`.
|
|
331
|
+
*/
|
|
332
|
+
function isAllowVerificationRequested(e) {
|
|
333
|
+
if (e.type !== "verification_requested") {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
return e.action === "allow";
|
|
337
|
+
}
|
|
179
338
|
function getToolCallsSinceLastVerification(actionsFile) {
|
|
180
|
-
const entries =
|
|
339
|
+
const entries = readActionsSinceMatch(actionsFile, isAllowVerificationRequested);
|
|
181
340
|
return entries.filter((e) => e.type === "tool_call");
|
|
182
341
|
}
|
|
183
342
|
function getToolCallsSinceLastFileChange(actionsFile) {
|
|
@@ -189,7 +348,11 @@ function hasToolCallsSinceLastVerdict(actionsFile) {
|
|
|
189
348
|
return entries.some((e) => e.type === "tool_call");
|
|
190
349
|
}
|
|
191
350
|
function hasFileChangesSinceLastVerification(actionsFile) {
|
|
192
|
-
const entries =
|
|
351
|
+
const entries = readActionsSinceMatch(actionsFile, isAllowVerificationRequested);
|
|
193
352
|
return entries.some((e) => e.type === "file_change");
|
|
194
353
|
}
|
|
354
|
+
function getFileChangesSinceLastVerification(actionsFile) {
|
|
355
|
+
const entries = readActionsSinceMatch(actionsFile, isAllowVerificationRequested);
|
|
356
|
+
return entries.filter((e) => e.type === "file_change");
|
|
357
|
+
}
|
|
195
358
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/hooks/core/actions.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/hooks/core/actions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAgCH,gDAkBC;AAuJD,gCAsBC;AAgND,oCAiCC;AAMD,kEAwBC;AAED,gEAEC;AAqDD,8EAGC;AAED,0EAGC;AAED,oEAGC;AAED,kFAGC;AAED,kFAGC;AA5jBD,2BAAmF;AACnF,mCAAoC;AACpC,+BAAoE;AACpE,6C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,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACrF,CAAC;AAED,SAAgB,+BAA+B,CAAC,WAAmB;IAC/D,MAAM,OAAO,GAAY,0BAA0B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAChF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAQ,EAAuB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACrF,CAAC;AAED,SAAgB,4BAA4B,CAAC,WAAmB;IAC5D,MAAM,OAAO,GAAY,0BAA0B,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAClF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAQ,EAAW,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACvE,CAAC;AAED,SAAgB,mCAAmC,CAAC,WAAmB;IACnE,MAAM,OAAO,GAAY,qBAAqB,CAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC;IAC1F,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAQ,EAAW,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;AACzE,CAAC;AAED,SAAgB,mCAAmC,CAAC,WAAmB;IACnE,MAAM,OAAO,GAAY,qBAAqB,CAAC,WAAW,EAAE,4BAA4B,CAAC,CAAC;IAC1F,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAQ,EAAyB,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IronBee — activity-end core
|
|
3
|
+
*
|
|
4
|
+
* Stop-hook handler used in monitoring-only mode (verification disabled).
|
|
5
|
+
* Closes the active activity and triggers a background queue flush so the
|
|
6
|
+
* `send_event` jobs accumulated during the turn ship to the collector before
|
|
7
|
+
* the next turn starts.
|
|
8
|
+
*
|
|
9
|
+
* Pairs with `activity-start` (the always-installed UserPromptSubmit handler);
|
|
10
|
+
* the enabled-mode equivalent is `verify-gate`, which does the same activity
|
|
11
|
+
* close + queue flush plus the full multi-cycle verification check.
|
|
12
|
+
*/
|
|
13
|
+
export interface ActivityEndInput {
|
|
14
|
+
sessionDir: string;
|
|
15
|
+
actionsFile: string;
|
|
16
|
+
projectDir: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function runActivityEnd(input: ActivityEndInput): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=activity-end.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-end.d.ts","sourceRoot":"","sources":["../../../src/hooks/core/activity-end.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,MAAM,WAAW,gBAAgB;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBee — activity-end core
|
|
4
|
+
*
|
|
5
|
+
* Stop-hook handler used in monitoring-only mode (verification disabled).
|
|
6
|
+
* Closes the active activity and triggers a background queue flush so the
|
|
7
|
+
* `send_event` jobs accumulated during the turn ship to the collector before
|
|
8
|
+
* the next turn starts.
|
|
9
|
+
*
|
|
10
|
+
* Pairs with `activity-start` (the always-installed UserPromptSubmit handler);
|
|
11
|
+
* the enabled-mode equivalent is `verify-gate`, which does the same activity
|
|
12
|
+
* close + queue flush plus the full multi-cycle verification check.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.runActivityEnd = runActivityEnd;
|
|
16
|
+
const activity_1 = require("./activity");
|
|
17
|
+
const queue_1 = require("../../queue");
|
|
18
|
+
async function runActivityEnd(input) {
|
|
19
|
+
const { sessionDir, actionsFile, projectDir, sessionId } = input;
|
|
20
|
+
await (0, activity_1.endActivity)({ sessionDir, actionsFile });
|
|
21
|
+
(0, queue_1.flushInBackground)(projectDir, sessionId);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=activity-end.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-end.js","sourceRoot":"","sources":["../../../src/hooks/core/activity-end.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAYH,wCAIC;AAdD,yCAAyC;AACzC,uCAAgD;AASzC,KAAK,UAAU,cAAc,CAAC,KAAuB;IACxD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACjE,MAAM,IAAA,sBAAW,EAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/C,IAAA,yBAAiB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AAC7C,CAAC"}
|