t44 0.4.0-rc.4 → 0.4.0-rc.6
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.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: Gordian Open Integrity
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
gordian-open-integrity:
|
|
7
|
+
name: Gordian Open Integrity
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
with:
|
|
12
|
+
fetch-depth: 0
|
|
13
|
+
- uses: Stream44/t44-blockchaincommons.com@main
|
package/README.md
CHANGED
|
@@ -168,6 +168,8 @@ sandboxes only able to leverage capabilities specifically given.
|
|
|
168
168
|
Provenance
|
|
169
169
|
===
|
|
170
170
|
|
|
171
|
+
[](https://github.com/Stream44/t44/actions/workflows/gordian-open-integrity.yaml?query=branch%3Amain) [](https://github.com/Stream44/t44/actions/workflows/dco.yaml?query=branch%3Amain)
|
|
172
|
+
|
|
171
173
|
Repository DID: `did:repo:7d0bdb82f70c6b3dfade356f9e667cdd0cf0cc88`
|
|
172
174
|
|
|
173
175
|
<table>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "t44",
|
|
3
|
-
"version": "0.4.0-rc.
|
|
3
|
+
"version": "0.4.0-rc.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
"./workspace-rt": "./workspace-rt.ts",
|
|
15
|
+
"./standalone-rt": "./standalone-rt.ts",
|
|
15
16
|
"./caps/Home": "./caps/Home.ts",
|
|
16
17
|
"./caps/HomeRegistry": "./caps/HomeRegistry.ts",
|
|
17
18
|
"./caps/OpenApiSchema": "./caps/OpenApiSchema.ts",
|
|
@@ -84,9 +85,9 @@
|
|
|
84
85
|
"@ucanto/principal": "^9.0.3",
|
|
85
86
|
"@ucanto/server": "^11.0.3",
|
|
86
87
|
"json-schema-ref-resolver": "^3.0.0",
|
|
87
|
-
"@stream44.studio/encapsulate": "^0.4.0-rc.
|
|
88
|
-
"@stream44.studio/dco": "^0.3.0-rc.
|
|
89
|
-
"@stream44.studio/t44-blockchaincommons.com": "^0.1.0-rc.
|
|
88
|
+
"@stream44.studio/encapsulate": "^0.4.0-rc.7",
|
|
89
|
+
"@stream44.studio/dco": "^0.3.0-rc.6",
|
|
90
|
+
"@stream44.studio/t44-blockchaincommons.com": "^0.1.0-rc.6"
|
|
90
91
|
},
|
|
91
92
|
"devDependencies": {
|
|
92
93
|
"@types/bun": "^1.3.4",
|
package/standalone-rt.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/// <reference types="bun" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
|
|
5
|
+
const startTime = Date.now()
|
|
6
|
+
|
|
7
|
+
import chalk from 'chalk'
|
|
8
|
+
import { CapsuleSpineFactory } from "@stream44.studio/encapsulate/spine-factories/CapsuleSpineFactory.v0"
|
|
9
|
+
import { CapsuleSpineContract } from "@stream44.studio/encapsulate/spine-contracts/CapsuleSpineContract.v0/Membrane.v0"
|
|
10
|
+
import { TimingObserver } from "@stream44.studio/encapsulate/spine-factories/TimingObserver"
|
|
11
|
+
|
|
12
|
+
export async function run(encapsulateHandler: any, runHandler: any, options?: { importMeta?: { dir: string } }) {
|
|
13
|
+
|
|
14
|
+
const timing = process.argv.includes('--trace') ? TimingObserver({ startTime }) : undefined
|
|
15
|
+
|
|
16
|
+
timing?.recordMajor('INIT SPINE')
|
|
17
|
+
|
|
18
|
+
const eventsByKey = new Map<string, any>()
|
|
19
|
+
|
|
20
|
+
const { encapsulate, freeze, CapsulePropertyTypes, makeImportStack, hoistSnapshot } = await CapsuleSpineFactory({
|
|
21
|
+
spineFilesystemRoot: process.cwd(),
|
|
22
|
+
capsuleModuleProjectionRoot: (import.meta as any).dir,
|
|
23
|
+
enableCallerStackInference: true,
|
|
24
|
+
spineContracts: {
|
|
25
|
+
['#' + CapsuleSpineContract['#']]: CapsuleSpineContract
|
|
26
|
+
},
|
|
27
|
+
timing,
|
|
28
|
+
onMembraneEvent: timing ? (event: any) => {
|
|
29
|
+
const instanceId = event.target?.spineContractCapsuleInstanceId
|
|
30
|
+
const eventIndex = event.eventIndex
|
|
31
|
+
|
|
32
|
+
// Store event by composite key (instance ID + event index)
|
|
33
|
+
const key = `${eventIndex}`
|
|
34
|
+
eventsByKey.set(key, event)
|
|
35
|
+
|
|
36
|
+
let capsuleRef = event.target?.capsuleSourceLineRef
|
|
37
|
+
let prop = event.target?.prop
|
|
38
|
+
let callerLocation = event.caller ? `${event.caller.filepath}:${event.caller.line}` : 'unknown'
|
|
39
|
+
const eventType = event.event
|
|
40
|
+
|
|
41
|
+
// For call-result events, look up the original call event to get all info
|
|
42
|
+
if (eventType === 'call-result') {
|
|
43
|
+
const callKey = `${event.callEventIndex}`
|
|
44
|
+
const callEvent = eventsByKey.get(callKey)
|
|
45
|
+
if (callEvent) {
|
|
46
|
+
capsuleRef = callEvent.target?.capsuleSourceLineRef || capsuleRef
|
|
47
|
+
prop = callEvent.target?.prop || prop
|
|
48
|
+
if (callEvent.caller) {
|
|
49
|
+
callerLocation = `${callEvent.caller.filepath}:${callEvent.caller.line}`
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.error(
|
|
55
|
+
chalk.gray(`[${eventIndex}]`),
|
|
56
|
+
chalk.cyan(eventType.padEnd(12)),
|
|
57
|
+
chalk.yellow(capsuleRef),
|
|
58
|
+
chalk.magenta(`.${prop}`),
|
|
59
|
+
chalk.dim(`from ${callerLocation}`)
|
|
60
|
+
)
|
|
61
|
+
} : undefined
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
timing?.recordMajor('ENCAPSULATE')
|
|
65
|
+
|
|
66
|
+
const exportedApi = await encapsulateHandler({
|
|
67
|
+
encapsulate,
|
|
68
|
+
CapsulePropertyTypes,
|
|
69
|
+
makeImportStack
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
timing?.recordMajor('FREEZE')
|
|
73
|
+
|
|
74
|
+
const snapshot = await freeze()
|
|
75
|
+
|
|
76
|
+
timing?.recordMajor('HOIST SNAPSHOT')
|
|
77
|
+
|
|
78
|
+
const { run } = await hoistSnapshot({
|
|
79
|
+
snapshot
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
timing?.recordMajor('RUN')
|
|
83
|
+
|
|
84
|
+
const result = await run({
|
|
85
|
+
overrides: {
|
|
86
|
+
['t44/caps/WorkspaceTest']: {
|
|
87
|
+
'#': {
|
|
88
|
+
testRootDir: options?.importMeta?.dir
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, async (opts) => {
|
|
93
|
+
return runHandler({
|
|
94
|
+
...opts,
|
|
95
|
+
...(exportedApi || {})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
timing?.recordMajor('DONE')
|
|
100
|
+
|
|
101
|
+
return result
|
|
102
|
+
}
|