@tomflow/chatloop-extension 0.4.8 → 0.4.9

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.
@@ -157,7 +157,10 @@ function createApiAspect(packageName,{sink,bufferUntilSubscribe=false}={}){
157
157
  let result;
158
158
  try{
159
159
  const storage=base?contextStore():null;
160
- result=storage?storage.run({traceId:base.traceId,spanId:base.spanId},execute)
160
+ // A context-inspection API must see its caller's span, not the
161
+ // observation span created to record the inspection itself.
162
+ result=storage&&!options?.preserveCallerContext
163
+ ?storage.run({traceId:base.traceId,spanId:base.spanId},execute)
161
164
  :execute();
162
165
  }catch(e){mark('FAILED',e);throw e}
163
166
  const failed=value=>{
@@ -226,6 +229,8 @@ function createApiAspect(packageName,{sink,bufferUntilSubscribe=false}={}){
226
229
  const value=Reflect.get(object,key,receiver);
227
230
  if(typeof value!=='function'||typeof key!=='string'
228
231
  ||(descriptors&&!Object.hasOwn(descriptors,key)))return value;
232
+ // Existing public proxies already own a complete BEGIN/terminal pair.
233
+ if(value[Symbol.for('chat-loop.api-observed.v1')]===true)return value;
229
234
  if(!cache.has(key))cache.set(key,wrap(key,value));
230
235
  return cache.get(key);
231
236
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chat Loop Extension",
4
- "version": "0.4.8",
4
+ "version": "0.4.9",
5
5
  "description": "Chat Loop browser companion: Eye actions, Turn observer, Continue and Handoff Actions",
6
6
  "permissions": [
7
7
  "activeTab",
package/index.mjs CHANGED
@@ -11,10 +11,9 @@ const observationSender=createOrderedApiObservationSender(record=>
11
11
  const INTERNAL_DRAIN=Symbol.for('chat-loop.telemetry.drain.internal');
12
12
  const apiAspect=createApiAspect('@tomflow/chatloop-extension',{
13
13
  sink:record=>{
14
- // The audit transport itself must never trigger another Native audit.
15
- // The wrapper still intercepts it, but re-emitting it would recurse.
16
- if(record.api==='nativeHostApi'||
17
- record.api==='nativeHostApi.nativeApiObservation')return;
14
+ // The sink uses the private raw IPC transport, not the exported Native
15
+ // callable. Public nativeHostApi/nativeApiObservation calls therefore
16
+ // remain observable without re-entering their own AOP wrappers.
18
17
  return observationSender.send({
19
18
  callId:record.callId,traceId:record.traceId,spanId:record.spanId,
20
19
  ...(record.parentSpanId?{parentSpanId:record.parentSpanId}:{}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomflow/chatloop-extension",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "type": "module",
5
5
  "description": "Chat Loop Extension package: nine formal Action pages and its own native CLI bridge",
6
6
  "bin": {
@@ -33,6 +33,6 @@
33
33
  ".": "./index.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@tomflow/chatloop-trace": "0.4.2"
36
+ "@tomflow/chatloop-trace": "0.4.3"
37
37
  }
38
38
  }