sidekick-shared 0.24.0 → 0.24.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.
@@ -25,13 +25,23 @@ function projectSessionTranscript(events, options = {}) {
25
25
  const usageCosts = [];
26
26
  const totals = { ...EMPTY_TOTALS };
27
27
  const toolsById = new Map();
28
+ let cwd;
29
+ let gitBranch;
28
30
  events.forEach((event, eventIndex) => {
31
+ if (nonEmpty(event.cwd))
32
+ cwd = event.cwd;
33
+ if (nonEmpty(event.gitBranch))
34
+ gitBranch = event.gitBranch;
29
35
  const message = event.message;
30
36
  const source = {
31
37
  provider: options.provider ?? event.providerMetadata?.providerId,
32
38
  sessionId: options.sessionId,
33
39
  sourcePath: options.sourcePath,
34
40
  source: event.providerMetadata?.source,
41
+ entrypoint: event.entrypoint,
42
+ isMeta: event.isMeta,
43
+ isSidechain: event.isSidechain,
44
+ originalRole: message?.role,
35
45
  eventIndex,
36
46
  eventType: event.type,
37
47
  eventId: message?.id,
@@ -119,6 +129,8 @@ function projectSessionTranscript(events, options = {}) {
119
129
  provider: options.provider,
120
130
  sessionId: options.sessionId,
121
131
  sourcePath: options.sourcePath,
132
+ cwd,
133
+ gitBranch,
122
134
  startedAt: events[0]?.timestamp,
123
135
  endedAt: events.at(-1)?.timestamp,
124
136
  models: [...models],
@@ -136,6 +148,9 @@ function projectSessionTranscript(events, options = {}) {
136
148
  provenance: { source: 'session-events', fidelity, eventCount: events.length },
137
149
  };
138
150
  }
151
+ function nonEmpty(value) {
152
+ return typeof value === 'string' && value.trim().length > 0;
153
+ }
139
154
  function roleForEvent(event) {
140
155
  if (event.type === 'summary')
141
156
  return 'summary';
@@ -57,8 +57,16 @@ export interface SessionMessage {
57
57
  export interface SessionEventBase {
58
58
  /** ISO 8601 timestamp of event */
59
59
  timestamp: string;
60
+ /** Provider-reported entrypoint that produced this event. */
61
+ entrypoint?: string;
62
+ /** Whether the provider identifies this as orchestration or metadata. */
63
+ isMeta?: boolean;
60
64
  /** Whether this is a subagent/sidechain event */
61
65
  isSidechain?: boolean;
66
+ /** Provider-reported working directory for this event/session. */
67
+ cwd?: string;
68
+ /** Provider-reported git branch for this event/session. */
69
+ gitBranch?: string;
62
70
  /** Permission mode active when this event occurred */
63
71
  permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan';
64
72
  /** Subscription rate limits, when provided by the session source. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sidekick-shared",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "Shared data access layer for Sidekick — readers, types, providers, credentials, quota",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",