stable-harness 0.0.111 → 0.0.112
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/node_modules/@stable-harness/adapter-deepagents/package.json +2 -2
- package/node_modules/@stable-harness/adapter-langgraph/package.json +2 -2
- package/node_modules/@stable-harness/core/dist/trace.js +1 -1
- package/node_modules/@stable-harness/core/package.json +3 -3
- package/node_modules/@stable-harness/governance/package.json +1 -1
- package/node_modules/@stable-harness/memory/package.json +1 -1
- package/node_modules/@stable-harness/protocols/package.json +2 -2
- package/node_modules/@stable-harness/tool-gateway/package.json +1 -1
- package/node_modules/@stable-harness/workspace-yaml/package.json +2 -2
- package/package.json +9 -9
- package/packages/adapter-deepagents/package.json +2 -2
- package/packages/adapter-langgraph/package.json +2 -2
- package/packages/cli/package.json +8 -8
- package/packages/core/dist/trace.js +1 -1
- package/packages/core/package.json +3 -3
- package/packages/evaluation/package.json +2 -2
- package/packages/governance/package.json +1 -1
- package/packages/memory/package.json +1 -1
- package/packages/protocols/package.json +2 -2
- package/packages/tool-gateway/package.json +1 -1
- package/packages/workspace-yaml/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/adapter-deepagents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@langchain/node-vfs": "^0.1.4",
|
|
16
16
|
"@langchain/ollama": "^1.2.7",
|
|
17
17
|
"@langchain/openai": "^1.4.5",
|
|
18
|
-
"@stable-harness/core": "0.0.
|
|
18
|
+
"@stable-harness/core": "0.0.112",
|
|
19
19
|
"deepagents": "^1.10.1",
|
|
20
20
|
"langchain": "^1.4.0"
|
|
21
21
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/adapter-langgraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"types": "dist/src/index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@langchain/langgraph": "^1.3.0",
|
|
14
|
-
"@stable-harness/core": "0.0.
|
|
14
|
+
"@stable-harness/core": "0.0.112"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function createDelegationTraceProjection(e
|
|
1
|
+
export function createDelegationTraceProjection(t,e={}){return{traceType:"delegation",traceLabel:t,...e}}export function createPlanTraceProjection(t,e={}){return{traceType:"plan",traceLabel:t,...e}}export function projectRuntimeTrace(t){return t.events.map(projectEvent).filter(isTraceEntry)}export function projectRuntimeTraceSpans(t){const e=function createSpanBuilder(t){const e=`run:${t.requestId}`,r=[],o=new Map;return{ensureRoot(){if(o.has(e))return;const n={spanId:e,requestId:t.requestId,sessionId:t.sessionId,agentId:t.agentId,kind:"run",name:t.agentId,status:(a=t.state,"completed"===a?"completed":"failed"===a?"failed":"cancelled"===a?"blocked":"running"),startedAt:t.startedAt,completedAt:t.completedAt,startEventIndex:0,...t.parentRunId?{parentSpanId:`run:${t.parentRunId}`}:{},events:[]};var a;r.push(n),o.set(e,n)},markRoot(t,r,n,a){const i=o.get(e);i&&(addEvent(i,t,r),i.status=n,i.attributes=merge(i.attributes,a),"running"!==n&&close(i,t,r))},start(t,n,a,i,s,d){const p=createSpan(`${e}/${t}:${s}`,e,n,a,i,s,d);r.push(p),o.set(t,p)},complete(t,n,a,i){const s=o.get(t)??createSpan(`${e}/${t}:${a}`,e,"adapter",t,n,a);return o.has(t)||r.push(s),addEvent(s,n,a),s.attributes=merge(s.attributes,i),close(s,n,a),o.delete(t),s},fail(t,e,r,o){this.complete(t,e,r,o).status="failed"},event(t,o,n,a,i){const s=createSpan(`${e}/event:${a}`,e,t,o,n,a,i);s.status=function readBlockedStatus(t){return t.type.endsWith(".blocked")||t.type.includes(".approval.")?"blocked":void 0}(n)??"event",close(s,n,a),r.push(s)},closeRoot(){const r=o.get(e);r&&t.completedAt&&(r.completedAt=t.completedAt)},spans:()=>r}}(t);return e.ensureRoot(),t.events.forEach((t,r)=>function projectSpanEvent(t,e,r){return e.type.startsWith("runtime.request.")?function projectRequestSpanEvent(t,e,r){return"runtime.request.started"===e.type?t.markRoot(e,r,"running",{input:e.input}):"runtime.request.completed"===e.type?t.markRoot(e,r,"completed",{output:e.output}):"runtime.request.failed"===e.type?t.markRoot(e,r,"failed",{error:e.error}):"runtime.request.cancelled"===e.type?t.markRoot(e,r,"blocked",{reason:e.reason}):"runtime.execution.contract.failed"===e.type?projectSingleSpan(t,e,r,"quality",e.type,{reason:e.reason,missingEvidenceTools:e.missingEvidenceTools}):void 0}(t,e,r):"runtime.tool.direct.started"===e.type?t.start(`tool:${e.toolId}`,"tool",e.toolId,e,r,{toolId:e.toolId}):"runtime.tool.direct.completed"===e.type?t.complete(`tool:${e.toolId}`,e,r,{toolId:e.toolId,output:e.output}):"runtime.workflow.started"===e.type?t.start(`workflow:${e.workflowId}`,"workflow",e.workflowId,e,r,{workflowId:e.workflowId,adapter:e.adapter}):"runtime.workflow.completed"===e.type?t.complete(`workflow:${e.workflowId}`,e,r,{workflowId:e.workflowId,adapter:e.adapter}):e.type.startsWith("runtime.approval.")||e.type.startsWith("runtime.memory.approval.")?projectSingleSpan(t,e,r,"approval",e.type):e.type.startsWith("runtime.specDriven.phase.")?projectSingleSpan(t,e,r,"spec",function readPhaseName(t,e){return"phaseId"in t&&"string"==typeof t.phaseId?t.phaseId:e}(e,"phase")):e.type.startsWith("runtime.memory.")?projectSingleSpan(t,e,r,"memory",e.type):e.type.startsWith("runtime.quality.")?projectSingleSpan(t,e,r,"quality",e.type):e.type.startsWith("runtime.repair.")?projectSingleSpan(t,e,r,"adapter",e.type):"runtime.artifact.created"===e.type?projectSingleSpan(t,e,r,"artifact",e.artifact.id,{artifact:e.artifact}):"runtime.progress.narration"===e.type?projectSingleSpan(t,e,r,"progress",e.message,{provider:e.provider}):"runtime.adapter.event"===e.type?function projectAdapterSpanEvent(t,e,r){const o=isRecord(e.event)?e.event:void 0,n=readString(o?.phase)??"runtime.adapter.event",a=readTraceType(o?.traceType),i=readString(o?.traceLabel);return"delegation"===a&&i?.endsWith(".start")?t.start(delegationKey(o),"delegation",readString(o?.subagentType)??i,e,r,o):"delegation"===a&&i?.endsWith(".completed")?t.complete(delegationKey(o),e,r,o):"plan"===a&&i?projectSingleSpan(t,e,r,"plan",i,o):function isToolStartEvent(t){return"deepagents.tool_execution.start"===t?.eventType||"agent.tool.start"===t?.phase}(o)?t.start(`agent-tool:${readString(o?.toolId)??"unknown"}`,"tool",readString(o?.toolId)??n,e,r,o):function isToolResultEvent(t){return"deepagents.tool_execution.result"===t?.eventType||"agent.tool.result"===t?.phase}(o)?t.complete(`agent-tool:${readString(o?.toolId)??"unknown"}`,e,r,o):projectSingleSpan(t,e,r,"adapter",n,o)}(t,e,r):"runtime.inventory.repair"===e.type?projectSingleSpan(t,e,r,"adapter","runtime.inventory.repair",{status:e.status,...e.diagnostic}):"runtime.sandbox.decision"===e.type?projectSingleSpan(t,e,r,"tool",`sandbox:${e.toolId}`,{toolId:e.toolId,...e.decision}):"runtime.tool.failure"===e.type?t.fail(`tool:${e.toolId}`,e,r,{toolId:e.toolId,...e.failure}):"runtime.tool.circuit.opened"===e.type?projectSingleSpan(t,e,r,"tool",`circuit:${e.toolId}`,{toolId:e.toolId,reason:e.reason}):void 0}(e,t,r)),e.closeRoot(),e.spans()}export function projectEvent(t){return"runtime.request.started"===t.type||"runtime.request.completed"===t.type||"runtime.request.failed"===t.type?base(t,"request",t.type):"runtime.request.cancelled"===t.type?base(t,"request",t.type,{reason:t.reason}):"runtime.execution.contract.failed"===t.type?base(t,"request",t.type,{reason:t.reason,missingEvidenceTools:t.missingEvidenceTools}):"runtime.inventory.repair"===t.type?base(t,"adapter","runtime.inventory.repair",{status:t.status,...t.diagnostic}):"runtime.repair.started"===t.type||"runtime.repair.completed"===t.type?base(t,"adapter",t.type,{layer:t.layer,..."outcome"in t?{outcome:t.outcome}:{},..."attempt"in t?{attempt:t.attempt}:{},..."reason"in t?{reason:t.reason}:{},...t.diagnostics?{diagnostics:t.diagnostics}:{}}):"runtime.tool.direct.started"===t.type?base(t,"tool","runtime.tool.direct.started",{toolId:t.toolId}):"runtime.tool.direct.completed"===t.type?base(t,"tool","runtime.tool.direct.completed",{toolId:t.toolId,...outputTraceDetail(t.output)}):"runtime.sandbox.decision"===t.type?base(t,"tool","runtime.sandbox.decision",{toolId:t.toolId,...t.decision}):"runtime.tool.failure"===t.type?base(t,"tool","runtime.tool.failure",{toolId:t.toolId,...t.failure}):"runtime.tool.circuit.opened"===t.type?base(t,"tool","runtime.tool.circuit.opened",{toolId:t.toolId,reason:t.reason}):"runtime.workflow.started"===t.type||"runtime.workflow.completed"===t.type?base(t,"workflow",t.type,{workflowId:t.workflowId,adapter:t.adapter}):function isSpecDrivenPhaseEvent(t){return t.type.startsWith("runtime.specDriven.phase.")}(t)?base(t,"spec",t.type,{phaseId:t.phaseId,..."workflowId"in t&&t.workflowId?{workflowId:t.workflowId}:{},..."reason"in t?{reason:t.reason}:{},..."artifact"in t&&t.artifact?{artifact:t.artifact}:{}}):"runtime.adapter.event"===t.type?function adapterTrace(t){const e=t.event;if(isRecord(e)&&"string"==typeof e.phase){const r=function semanticAdapterTrace(t,e){if("inventory.repair"===e.phase)return base(t,"adapter","runtime.inventory.repair",{status:e.status,...isRecord(e.diagnostic)?e.diagnostic:{}});const r=readTraceType(e.traceType),o=readString(e.traceLabel);return r&&o?base(t,r,o,e):void 0}(t,e);return r||base(t,"adapter",e.phase.startsWith("agent.")?e.phase:`adapter.${e.phase}`,e)}return base(t,"adapter","runtime.adapter.event",{event:e})}(t):"runtime.artifact.created"===t.type?base(t,"artifact","runtime.artifact.created",{artifact:t.artifact}):t.type.startsWith("runtime.memory.")?base(t,"memory",t.type):"runtime.progress.narration"===t.type?base(t,"progress",t.type,{message:t.message,provider:t.provider,sourceEventTypes:t.sourceEventTypes}):void 0}export function readPlanTodos(t){const e=function readPlanRecord(t){if(isRecord(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);return isRecord(e)?e:void 0}catch{return}}(t),r=function readTodosArray(t){const e=isRecord(t?.args)?t.args:void 0;return Array.isArray(t?.todos)?t.todos:Array.isArray(e?.todos)?e.todos:[]}(e);return r.map(readTodo).filter(isPlanTodoItem)}function readTodo(t){if(isRecord(t)&&"string"==typeof t.content)return{content:t.content,status:"string"==typeof t.status?t.status:"pending"}}function isPlanTodoItem(t){return void 0!==t}function base(t,e,r,o){return{type:e,label:r,agentId:t.agentId,requestId:t.requestId,detail:o}}function isTraceEntry(t){return void 0!==t}function outputTraceDetail(t){const e="string"==typeof t?t:function serializeOutput(t){try{return void 0===t?"":JSON.stringify(t)}catch{return String(t)}}(t),r=e.slice(0,1200);return{outputType:Array.isArray(t)?"array":null===t?"null":typeof t,outputLength:e.length,outputPreview:r,...e.length>r.length?{outputTail:e.slice(-1200)}:{}}}function projectSingleSpan(t,e,r,o,n,a){return t.event(o,n,e,r,a)}function delegationKey(t){return`delegation:${readString(t?.subagentType)??readString(t?.toolId)??"task"}`}function createSpan(t,e,r,o,n,a,i){const s={spanId:t,parentSpanId:e,requestId:n.requestId,sessionId:n.sessionId,agentId:n.agentId,kind:r,name:o,status:"running",startedAt:n.emittedAt,startEventIndex:a,attributes:i,events:[]};return addEvent(s,n,a),s}function addEvent(t,e,r){t.events.push({index:r,eventId:e.eventId??`${e.requestId}:${r}`,type:e.type,emittedAt:e.emittedAt})}function close(t,e,r){t.status="failed"===t.status||"blocked"===t.status?t.status:"completed",t.completedAt=e.emittedAt,t.endEventIndex=r,t.durationMs=function durationMs(t,e){if(!t||!e)return;const r=Date.parse(e)-Date.parse(t);return Number.isFinite(r)&&r>=0?r:void 0}(t.startedAt,t.completedAt)}function merge(t,e){return e?{...t,...e}:t}function isRecord(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function readTraceType(t){const e=readString(t);return"request"===e||"tool"===e||"workflow"===e||"spec"===e||"adapter"===e||"memory"===e||"artifact"===e||"progress"===e||"plan"===e||"delegation"===e?e:void 0}function readString(t){return"string"==typeof t&&t.trim()?t:void 0}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
".": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@stable-harness/governance": "0.0.
|
|
15
|
-
"@stable-harness/memory": "0.0.
|
|
14
|
+
"@stable-harness/governance": "0.0.112",
|
|
15
|
+
"@stable-harness/memory": "0.0.112"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/protocols",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"main": "dist/src/index.js",
|
|
11
11
|
"types": "dist/src/index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@stable-harness/core": "0.0.
|
|
13
|
+
"@stable-harness/core": "0.0.112"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/workspace-yaml",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
".": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@stable-harness/core": "0.0.
|
|
14
|
+
"@stable-harness/core": "0.0.112"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stable-harness",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Stable application runtime and operator control plane for agent workspaces.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
"@langchain/node-vfs": "^0.1.4",
|
|
83
83
|
"@langchain/ollama": "^1.2.7",
|
|
84
84
|
"@langchain/openai": "^1.4.5",
|
|
85
|
-
"@stable-harness/adapter-deepagents": "0.0.
|
|
86
|
-
"@stable-harness/adapter-langgraph": "0.0.
|
|
87
|
-
"@stable-harness/core": "0.0.
|
|
88
|
-
"@stable-harness/governance": "0.0.
|
|
89
|
-
"@stable-harness/memory": "0.0.
|
|
90
|
-
"@stable-harness/protocols": "0.0.
|
|
91
|
-
"@stable-harness/tool-gateway": "0.0.
|
|
92
|
-
"@stable-harness/workspace-yaml": "0.0.
|
|
85
|
+
"@stable-harness/adapter-deepagents": "0.0.112",
|
|
86
|
+
"@stable-harness/adapter-langgraph": "0.0.112",
|
|
87
|
+
"@stable-harness/core": "0.0.112",
|
|
88
|
+
"@stable-harness/governance": "0.0.112",
|
|
89
|
+
"@stable-harness/memory": "0.0.112",
|
|
90
|
+
"@stable-harness/protocols": "0.0.112",
|
|
91
|
+
"@stable-harness/tool-gateway": "0.0.112",
|
|
92
|
+
"@stable-harness/workspace-yaml": "0.0.112",
|
|
93
93
|
"deepagents": "^1.10.1",
|
|
94
94
|
"langchain": "^1.4.0",
|
|
95
95
|
"yaml": "^2.8.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/adapter-deepagents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@langchain/node-vfs": "^0.1.4",
|
|
16
16
|
"@langchain/ollama": "^1.2.7",
|
|
17
17
|
"@langchain/openai": "^1.4.5",
|
|
18
|
-
"@stable-harness/core": "0.0.
|
|
18
|
+
"@stable-harness/core": "0.0.112",
|
|
19
19
|
"deepagents": "^1.10.1",
|
|
20
20
|
"langchain": "^1.4.0"
|
|
21
21
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/adapter-langgraph",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"types": "dist/src/index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@langchain/langgraph": "^1.3.0",
|
|
14
|
-
"@stable-harness/core": "0.0.
|
|
14
|
+
"@stable-harness/core": "0.0.112"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"types": "dist/src/index.d.ts",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@langchain/langgraph-api": "^1.2.1",
|
|
17
|
-
"@stable-harness/adapter-deepagents": "0.0.
|
|
18
|
-
"@stable-harness/adapter-langgraph": "0.0.
|
|
19
|
-
"@stable-harness/core": "0.0.
|
|
20
|
-
"@stable-harness/memory": "0.0.
|
|
21
|
-
"@stable-harness/protocols": "0.0.
|
|
22
|
-
"@stable-harness/tool-gateway": "0.0.
|
|
23
|
-
"@stable-harness/workspace-yaml": "0.0.
|
|
17
|
+
"@stable-harness/adapter-deepagents": "0.0.112",
|
|
18
|
+
"@stable-harness/adapter-langgraph": "0.0.112",
|
|
19
|
+
"@stable-harness/core": "0.0.112",
|
|
20
|
+
"@stable-harness/memory": "0.0.112",
|
|
21
|
+
"@stable-harness/protocols": "0.0.112",
|
|
22
|
+
"@stable-harness/tool-gateway": "0.0.112",
|
|
23
|
+
"@stable-harness/workspace-yaml": "0.0.112"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function createDelegationTraceProjection(e
|
|
1
|
+
export function createDelegationTraceProjection(t,e={}){return{traceType:"delegation",traceLabel:t,...e}}export function createPlanTraceProjection(t,e={}){return{traceType:"plan",traceLabel:t,...e}}export function projectRuntimeTrace(t){return t.events.map(projectEvent).filter(isTraceEntry)}export function projectRuntimeTraceSpans(t){const e=function createSpanBuilder(t){const e=`run:${t.requestId}`,r=[],o=new Map;return{ensureRoot(){if(o.has(e))return;const n={spanId:e,requestId:t.requestId,sessionId:t.sessionId,agentId:t.agentId,kind:"run",name:t.agentId,status:(a=t.state,"completed"===a?"completed":"failed"===a?"failed":"cancelled"===a?"blocked":"running"),startedAt:t.startedAt,completedAt:t.completedAt,startEventIndex:0,...t.parentRunId?{parentSpanId:`run:${t.parentRunId}`}:{},events:[]};var a;r.push(n),o.set(e,n)},markRoot(t,r,n,a){const i=o.get(e);i&&(addEvent(i,t,r),i.status=n,i.attributes=merge(i.attributes,a),"running"!==n&&close(i,t,r))},start(t,n,a,i,s,d){const p=createSpan(`${e}/${t}:${s}`,e,n,a,i,s,d);r.push(p),o.set(t,p)},complete(t,n,a,i){const s=o.get(t)??createSpan(`${e}/${t}:${a}`,e,"adapter",t,n,a);return o.has(t)||r.push(s),addEvent(s,n,a),s.attributes=merge(s.attributes,i),close(s,n,a),o.delete(t),s},fail(t,e,r,o){this.complete(t,e,r,o).status="failed"},event(t,o,n,a,i){const s=createSpan(`${e}/event:${a}`,e,t,o,n,a,i);s.status=function readBlockedStatus(t){return t.type.endsWith(".blocked")||t.type.includes(".approval.")?"blocked":void 0}(n)??"event",close(s,n,a),r.push(s)},closeRoot(){const r=o.get(e);r&&t.completedAt&&(r.completedAt=t.completedAt)},spans:()=>r}}(t);return e.ensureRoot(),t.events.forEach((t,r)=>function projectSpanEvent(t,e,r){return e.type.startsWith("runtime.request.")?function projectRequestSpanEvent(t,e,r){return"runtime.request.started"===e.type?t.markRoot(e,r,"running",{input:e.input}):"runtime.request.completed"===e.type?t.markRoot(e,r,"completed",{output:e.output}):"runtime.request.failed"===e.type?t.markRoot(e,r,"failed",{error:e.error}):"runtime.request.cancelled"===e.type?t.markRoot(e,r,"blocked",{reason:e.reason}):"runtime.execution.contract.failed"===e.type?projectSingleSpan(t,e,r,"quality",e.type,{reason:e.reason,missingEvidenceTools:e.missingEvidenceTools}):void 0}(t,e,r):"runtime.tool.direct.started"===e.type?t.start(`tool:${e.toolId}`,"tool",e.toolId,e,r,{toolId:e.toolId}):"runtime.tool.direct.completed"===e.type?t.complete(`tool:${e.toolId}`,e,r,{toolId:e.toolId,output:e.output}):"runtime.workflow.started"===e.type?t.start(`workflow:${e.workflowId}`,"workflow",e.workflowId,e,r,{workflowId:e.workflowId,adapter:e.adapter}):"runtime.workflow.completed"===e.type?t.complete(`workflow:${e.workflowId}`,e,r,{workflowId:e.workflowId,adapter:e.adapter}):e.type.startsWith("runtime.approval.")||e.type.startsWith("runtime.memory.approval.")?projectSingleSpan(t,e,r,"approval",e.type):e.type.startsWith("runtime.specDriven.phase.")?projectSingleSpan(t,e,r,"spec",function readPhaseName(t,e){return"phaseId"in t&&"string"==typeof t.phaseId?t.phaseId:e}(e,"phase")):e.type.startsWith("runtime.memory.")?projectSingleSpan(t,e,r,"memory",e.type):e.type.startsWith("runtime.quality.")?projectSingleSpan(t,e,r,"quality",e.type):e.type.startsWith("runtime.repair.")?projectSingleSpan(t,e,r,"adapter",e.type):"runtime.artifact.created"===e.type?projectSingleSpan(t,e,r,"artifact",e.artifact.id,{artifact:e.artifact}):"runtime.progress.narration"===e.type?projectSingleSpan(t,e,r,"progress",e.message,{provider:e.provider}):"runtime.adapter.event"===e.type?function projectAdapterSpanEvent(t,e,r){const o=isRecord(e.event)?e.event:void 0,n=readString(o?.phase)??"runtime.adapter.event",a=readTraceType(o?.traceType),i=readString(o?.traceLabel);return"delegation"===a&&i?.endsWith(".start")?t.start(delegationKey(o),"delegation",readString(o?.subagentType)??i,e,r,o):"delegation"===a&&i?.endsWith(".completed")?t.complete(delegationKey(o),e,r,o):"plan"===a&&i?projectSingleSpan(t,e,r,"plan",i,o):function isToolStartEvent(t){return"deepagents.tool_execution.start"===t?.eventType||"agent.tool.start"===t?.phase}(o)?t.start(`agent-tool:${readString(o?.toolId)??"unknown"}`,"tool",readString(o?.toolId)??n,e,r,o):function isToolResultEvent(t){return"deepagents.tool_execution.result"===t?.eventType||"agent.tool.result"===t?.phase}(o)?t.complete(`agent-tool:${readString(o?.toolId)??"unknown"}`,e,r,o):projectSingleSpan(t,e,r,"adapter",n,o)}(t,e,r):"runtime.inventory.repair"===e.type?projectSingleSpan(t,e,r,"adapter","runtime.inventory.repair",{status:e.status,...e.diagnostic}):"runtime.sandbox.decision"===e.type?projectSingleSpan(t,e,r,"tool",`sandbox:${e.toolId}`,{toolId:e.toolId,...e.decision}):"runtime.tool.failure"===e.type?t.fail(`tool:${e.toolId}`,e,r,{toolId:e.toolId,...e.failure}):"runtime.tool.circuit.opened"===e.type?projectSingleSpan(t,e,r,"tool",`circuit:${e.toolId}`,{toolId:e.toolId,reason:e.reason}):void 0}(e,t,r)),e.closeRoot(),e.spans()}export function projectEvent(t){return"runtime.request.started"===t.type||"runtime.request.completed"===t.type||"runtime.request.failed"===t.type?base(t,"request",t.type):"runtime.request.cancelled"===t.type?base(t,"request",t.type,{reason:t.reason}):"runtime.execution.contract.failed"===t.type?base(t,"request",t.type,{reason:t.reason,missingEvidenceTools:t.missingEvidenceTools}):"runtime.inventory.repair"===t.type?base(t,"adapter","runtime.inventory.repair",{status:t.status,...t.diagnostic}):"runtime.repair.started"===t.type||"runtime.repair.completed"===t.type?base(t,"adapter",t.type,{layer:t.layer,..."outcome"in t?{outcome:t.outcome}:{},..."attempt"in t?{attempt:t.attempt}:{},..."reason"in t?{reason:t.reason}:{},...t.diagnostics?{diagnostics:t.diagnostics}:{}}):"runtime.tool.direct.started"===t.type?base(t,"tool","runtime.tool.direct.started",{toolId:t.toolId}):"runtime.tool.direct.completed"===t.type?base(t,"tool","runtime.tool.direct.completed",{toolId:t.toolId,...outputTraceDetail(t.output)}):"runtime.sandbox.decision"===t.type?base(t,"tool","runtime.sandbox.decision",{toolId:t.toolId,...t.decision}):"runtime.tool.failure"===t.type?base(t,"tool","runtime.tool.failure",{toolId:t.toolId,...t.failure}):"runtime.tool.circuit.opened"===t.type?base(t,"tool","runtime.tool.circuit.opened",{toolId:t.toolId,reason:t.reason}):"runtime.workflow.started"===t.type||"runtime.workflow.completed"===t.type?base(t,"workflow",t.type,{workflowId:t.workflowId,adapter:t.adapter}):function isSpecDrivenPhaseEvent(t){return t.type.startsWith("runtime.specDriven.phase.")}(t)?base(t,"spec",t.type,{phaseId:t.phaseId,..."workflowId"in t&&t.workflowId?{workflowId:t.workflowId}:{},..."reason"in t?{reason:t.reason}:{},..."artifact"in t&&t.artifact?{artifact:t.artifact}:{}}):"runtime.adapter.event"===t.type?function adapterTrace(t){const e=t.event;if(isRecord(e)&&"string"==typeof e.phase){const r=function semanticAdapterTrace(t,e){if("inventory.repair"===e.phase)return base(t,"adapter","runtime.inventory.repair",{status:e.status,...isRecord(e.diagnostic)?e.diagnostic:{}});const r=readTraceType(e.traceType),o=readString(e.traceLabel);return r&&o?base(t,r,o,e):void 0}(t,e);return r||base(t,"adapter",e.phase.startsWith("agent.")?e.phase:`adapter.${e.phase}`,e)}return base(t,"adapter","runtime.adapter.event",{event:e})}(t):"runtime.artifact.created"===t.type?base(t,"artifact","runtime.artifact.created",{artifact:t.artifact}):t.type.startsWith("runtime.memory.")?base(t,"memory",t.type):"runtime.progress.narration"===t.type?base(t,"progress",t.type,{message:t.message,provider:t.provider,sourceEventTypes:t.sourceEventTypes}):void 0}export function readPlanTodos(t){const e=function readPlanRecord(t){if(isRecord(t))return t;if("string"==typeof t)try{const e=JSON.parse(t);return isRecord(e)?e:void 0}catch{return}}(t),r=function readTodosArray(t){const e=isRecord(t?.args)?t.args:void 0;return Array.isArray(t?.todos)?t.todos:Array.isArray(e?.todos)?e.todos:[]}(e);return r.map(readTodo).filter(isPlanTodoItem)}function readTodo(t){if(isRecord(t)&&"string"==typeof t.content)return{content:t.content,status:"string"==typeof t.status?t.status:"pending"}}function isPlanTodoItem(t){return void 0!==t}function base(t,e,r,o){return{type:e,label:r,agentId:t.agentId,requestId:t.requestId,detail:o}}function isTraceEntry(t){return void 0!==t}function outputTraceDetail(t){const e="string"==typeof t?t:function serializeOutput(t){try{return void 0===t?"":JSON.stringify(t)}catch{return String(t)}}(t),r=e.slice(0,1200);return{outputType:Array.isArray(t)?"array":null===t?"null":typeof t,outputLength:e.length,outputPreview:r,...e.length>r.length?{outputTail:e.slice(-1200)}:{}}}function projectSingleSpan(t,e,r,o,n,a){return t.event(o,n,e,r,a)}function delegationKey(t){return`delegation:${readString(t?.subagentType)??readString(t?.toolId)??"task"}`}function createSpan(t,e,r,o,n,a,i){const s={spanId:t,parentSpanId:e,requestId:n.requestId,sessionId:n.sessionId,agentId:n.agentId,kind:r,name:o,status:"running",startedAt:n.emittedAt,startEventIndex:a,attributes:i,events:[]};return addEvent(s,n,a),s}function addEvent(t,e,r){t.events.push({index:r,eventId:e.eventId??`${e.requestId}:${r}`,type:e.type,emittedAt:e.emittedAt})}function close(t,e,r){t.status="failed"===t.status||"blocked"===t.status?t.status:"completed",t.completedAt=e.emittedAt,t.endEventIndex=r,t.durationMs=function durationMs(t,e){if(!t||!e)return;const r=Date.parse(e)-Date.parse(t);return Number.isFinite(r)&&r>=0?r:void 0}(t.startedAt,t.completedAt)}function merge(t,e){return e?{...t,...e}:t}function isRecord(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function readTraceType(t){const e=readString(t);return"request"===e||"tool"===e||"workflow"===e||"spec"===e||"adapter"===e||"memory"===e||"artifact"===e||"progress"===e||"plan"===e||"delegation"===e?e:void 0}function readString(t){return"string"==typeof t&&t.trim()?t:void 0}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
".": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@stable-harness/governance": "0.0.
|
|
15
|
-
"@stable-harness/memory": "0.0.
|
|
14
|
+
"@stable-harness/governance": "0.0.112",
|
|
15
|
+
"@stable-harness/memory": "0.0.112"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/evaluation",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"main": "dist/src/index.js",
|
|
11
11
|
"types": "dist/src/index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@stable-harness/core": "0.0.
|
|
13
|
+
"@stable-harness/core": "0.0.112"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/protocols",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
"main": "dist/src/index.js",
|
|
11
11
|
"types": "dist/src/index.d.ts",
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@stable-harness/core": "0.0.
|
|
13
|
+
"@stable-harness/core": "0.0.112"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stable-harness/workspace-yaml",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*.js",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
".": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@stable-harness/core": "0.0.
|
|
14
|
+
"@stable-harness/core": "0.0.112"
|
|
15
15
|
}
|
|
16
16
|
}
|