@ibgib/web-gib 0.0.63 → 0.0.65
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/README.md +4 -0
- package/dist/AUTO-GENERATED-version.d.mts +1 -1
- package/dist/AUTO-GENERATED-version.mjs +1 -1
- package/dist/api/commands/ibgib/get-ibgibs.mjs +4 -4
- package/dist/api/commands/ibgib/get-ibgibs.mjs.map +1 -1
- package/dist/identity/device-delegate-helper.mjs +5 -5
- package/dist/identity/device-delegate-helper.mjs.map +1 -1
- package/dist/identity/keystone-sync-service.mjs +3 -3
- package/dist/identity/keystone-sync-service.mjs.map +1 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/dist/storage/storage-helpers.web.mjs +1 -1
- package/dist/storage/storage-helpers.web.mjs.map +1 -1
- package/dist/ui/component/identity/add-device/add-device.d.mts.map +1 -1
- package/dist/ui/component/identity/add-device/add-device.mjs +1 -1
- package/dist/ui/component/identity/add-device/add-device.mjs.map +1 -1
- package/dist/ui/component/identity/identity-header/identity-header.d.mts.map +1 -1
- package/dist/ui/component/identity/identity-header/identity-header.mjs +4 -4
- package/dist/ui/component/identity/identity-header/identity-header.mjs.map +1 -1
- package/dist/ui/component/identity/keystone-details/keystone-details.mjs +2 -2
- package/dist/ui/component/identity/keystone-details/keystone-details.mjs.map +1 -1
- package/dist/ui/component/privacy-policy/index.d.mts +11 -0
- package/dist/ui/component/privacy-policy/index.d.mts.map +1 -0
- package/dist/ui/component/privacy-policy/index.mjs +16 -0
- package/dist/ui/component/privacy-policy/index.mjs.map +1 -0
- package/dist/ui/component/privacy-policy/privacy-policy.css +263 -0
- package/dist/ui/component/privacy-policy/privacy-policy.d.mts +46 -0
- package/dist/ui/component/privacy-policy/privacy-policy.d.mts.map +1 -0
- package/dist/ui/component/privacy-policy/privacy-policy.html +27 -0
- package/dist/ui/component/privacy-policy/privacy-policy.mjs +128 -0
- package/dist/ui/component/privacy-policy/privacy-policy.mjs.map +1 -0
- package/dist/ui/ui-constants.d.mts +4 -0
- package/dist/ui/ui-constants.d.mts.map +1 -1
- package/dist/ui/ui-constants.mjs +6 -0
- package/dist/ui/ui-constants.mjs.map +1 -1
- package/dist/witness/agent/gemini/gemini-helpers.mjs +4 -4
- package/dist/witness/agent/gemini/gemini-helpers.mjs.map +1 -1
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-constants.d.mts +7 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-constants.d.mts.map +1 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-constants.mjs +7 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-constants.mjs.map +1 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-types.d.mts +24 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-types.d.mts.map +1 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-types.mjs +23 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-types.mjs.map +1 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.d.mts +85 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.d.mts.map +1 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.mjs +343 -0
- package/dist/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.mjs.map +1 -0
- package/package.json +5 -5
- package/src/AUTO-GENERATED-version.mts +1 -1
- package/src/api/commands/ibgib/get-ibgibs.mts +4 -4
- package/src/helpers.mts +1 -1
- package/src/helpers.web.respec.mts +41 -10
- package/src/identity/device-delegate-helper.mts +5 -5
- package/src/identity/keystone-sync-service.mts +3 -3
- package/src/index.mts +8 -0
- package/src/storage/storage-helpers.web.mts +1 -1
- package/src/ui/component/identity/add-device/add-device.mts +5 -4
- package/src/ui/component/identity/identity-header/identity-header.mts +4 -3
- package/src/ui/component/identity/keystone-details/keystone-details.mts +2 -2
- package/src/ui/component/privacy-policy/index.mts +18 -0
- package/src/ui/component/privacy-policy/privacy-policy.css +263 -0
- package/src/ui/component/privacy-policy/privacy-policy.html +27 -0
- package/src/ui/component/privacy-policy/privacy-policy.mts +168 -0
- package/src/ui/ui-constants.mts +7 -0
- package/src/witness/agent/gemini/gemini-helpers.mts +4 -4
- package/src/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-constants.mts +8 -0
- package/src/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-types.mts +53 -0
- package/src/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.mts +424 -0
- package/src/witness/space/web-in-memory-workspace-projection-space/web-in-memory-workspace-projection-space-v1.respec.mts +305 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-create-app/SKILL.md +65 -39
- package/tools/auto-generated-agent-skills/skills/ibgib-create-client-app/SKILL.md +51 -0
- package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/SKILL.md +26 -22
- package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/generate-id.js +1 -1
- package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/SKILL.md +11 -7
- package/tools/auto-generated-agent-skills/skills/ibgib-create-client-identity/SKILL.md +78 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-create-client-shell/SKILL.md +42 -0
- package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-server → ibgib-create-server-app}/SKILL.md +6 -6
- package/tools/auto-generated-agent-skills/skills/ibgib-create-server-app/templates/Dockerfile.template +14 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-create-server-app/templates/docker-compose.yml.template +33 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-create-server-app/templates/server.mts.template +97 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-create-server-app/templates/tsconfig.server.json.template +29 -0
- package/tools/auto-generated-agent-skills/skills/ibgib-implementation-plan/SKILL.md +11 -5
- package/tsconfig.json +2 -2
- package/dist/api/commands/command-service.respec.d.mts +0 -7
- package/dist/api/commands/command-service.respec.d.mts.map +0 -1
- package/dist/api/commands/command-service.respec.mjs +0 -66
- package/dist/api/commands/command-service.respec.mjs.map +0 -1
- package/dist/assumptions.respec.d.mts +0 -2
- package/dist/assumptions.respec.d.mts.map +0 -1
- package/dist/assumptions.respec.mjs +0 -41
- package/dist/assumptions.respec.mjs.map +0 -1
- package/dist/helpers.web.respec.d.mts +0 -2
- package/dist/helpers.web.respec.d.mts.map +0 -1
- package/dist/helpers.web.respec.mjs +0 -12
- package/dist/helpers.web.respec.mjs.map +0 -1
- package/dist/identity/device-delegate.respec.d.mts +0 -2
- package/dist/identity/device-delegate.respec.d.mts.map +0 -1
- package/dist/identity/device-delegate.respec.mjs +0 -106
- package/dist/identity/device-delegate.respec.mjs.map +0 -1
- package/dist/identity/passkey.respec.d.mts +0 -2
- package/dist/identity/passkey.respec.d.mts.map +0 -1
- package/dist/identity/passkey.respec.mjs +0 -169
- package/dist/identity/passkey.respec.mjs.map +0 -1
- package/dist/spec-helper.node.respec.d.mts +0 -13
- package/dist/spec-helper.node.respec.d.mts.map +0 -1
- package/dist/spec-helper.node.respec.mjs +0 -50
- package/dist/spec-helper.node.respec.mjs.map +0 -1
- package/dist/util/device-helper.respec.d.mts +0 -2
- package/dist/util/device-helper.respec.d.mts.map +0 -1
- package/dist/util/device-helper.respec.mjs +0 -83
- package/dist/util/device-helper.respec.mjs.map +0 -1
- package/tools/auto-generated-agent-skills/skills/ibgib-create-shell/SKILL.md +0 -40
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/generate-version-file.js +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/bootstrap.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/constants.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/declarations.d.ts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/helpers.web.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/index.html.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/index.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/script.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-core → ibgib-create-client-app-core}/templates/types.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/templates/api/function-infos.web.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/templates/witness/app/app-v1.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/templates/witness/app/constants.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/templates/witness/app/helper.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-app-witness → ibgib-create-client-app-witness}/templates/witness/app/types.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-shell → ibgib-create-client-shell}/templates/ui/shell/shell-constants.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-shell → ibgib-create-client-shell}/templates/ui/shell/shell-service.mts.template +0 -0
- /package/tools/auto-generated-agent-skills/skills/{ibgib-create-shell → ibgib-create-client-shell}/templates/ui/shell/shell-types.mts.template +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module web-in-memory-workspace-projection-space-v1.respec
|
|
3
|
+
*
|
|
4
|
+
* Unit tests for WebInMemoryWorkspaceProjectionSpace_V1 verifying in-memory
|
|
5
|
+
* virtual tree reification, scanning, glob filtering, status observation, and deletion.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
respecfully, ifWe, ifWeMight, iReckon, firstOfEach
|
|
10
|
+
} from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
|
|
11
|
+
|
|
12
|
+
import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
13
|
+
import { getGib } from '@ibgib/ts-gib/dist/V1/transforms/transform-helper.mjs';
|
|
14
|
+
import { hash } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
|
|
15
|
+
import { InnerSpace_V1 } from '@ibgib/core-gib/dist/witness/space/inner-space/inner-space-v1.mjs';
|
|
16
|
+
// import { getSpaceIdFromIb } from '@ibgib/core-gib/dist/witness/space/metaspace/metaspace-innerspace/metaspace-innerspace-helper.mjs';
|
|
17
|
+
import { DEFAULT_INNER_SPACE_DATA_V1 } from '@ibgib/core-gib/dist/witness/space/inner-space/inner-space-types.mjs';
|
|
18
|
+
import { putInSpace, persistTransformResult, registerNewIbGib } from '@ibgib/core-gib/dist/witness/space/space-helper.mjs';
|
|
19
|
+
import { CMD_MODIFIER_WORKSPACE_SCAN } from '@ibgib/core-gib/dist/witness/space/workspace-projection-space/workspace-projection-space-constants.mjs';
|
|
20
|
+
import { getBinIb } from '@ibgib/core-gib/dist/common/other/ibgib-helper.mjs';
|
|
21
|
+
import { BinIbGib_V1 } from '@ibgib/core-gib/dist/common/bin/bin-types.mjs';
|
|
22
|
+
import { createB2tFSItemIbGib } from '@ibgib/core-gib/dist/vcs/item/item-helper.mjs';
|
|
23
|
+
import { B2tFSItemIbGib_V1, BINARY_REL8N_NAME } from '@ibgib/core-gib/dist/vcs/item/item-types.mjs';
|
|
24
|
+
import { getRepoStatus } from '@ibgib/core-gib/dist/vcs/status/status-helper.mjs';
|
|
25
|
+
import { createB2tFSIndexIbGib, updateB2tFSIndexIbGib } from '@ibgib/core-gib/dist/vcs/index/index-helper.mjs';
|
|
26
|
+
import { B2tFSBranchIbGib_V1 } from '@ibgib/core-gib/dist/vcs/branch/branch-types.mjs';
|
|
27
|
+
|
|
28
|
+
import { WebInMemoryWorkspaceProjectionSpace_V1 } from './web-in-memory-workspace-projection-space-v1.mjs';
|
|
29
|
+
|
|
30
|
+
const lc = `[web-in-memory-workspace-projection-space-v1.respec.mts]`;
|
|
31
|
+
|
|
32
|
+
async function createFileWithContent({
|
|
33
|
+
name,
|
|
34
|
+
content,
|
|
35
|
+
space,
|
|
36
|
+
}: {
|
|
37
|
+
name: string;
|
|
38
|
+
content: string | Uint8Array;
|
|
39
|
+
space: any;
|
|
40
|
+
}): Promise<B2tFSItemIbGib_V1> {
|
|
41
|
+
const textStr = typeof content === 'string' ? content : new TextDecoder('utf8').decode(content);
|
|
42
|
+
const dataBuffer = typeof content === 'string' ? new TextEncoder().encode(content) : content;
|
|
43
|
+
const fileHash = await hash({ s: textStr });
|
|
44
|
+
|
|
45
|
+
const fileExt = name.includes('.') ? name.split('.').pop() || 'txt' : 'txt';
|
|
46
|
+
const binIb = getBinIb({
|
|
47
|
+
binHash: fileHash,
|
|
48
|
+
binExt: fileExt,
|
|
49
|
+
binEncoding: 'utf8',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const binIbGib: BinIbGib_V1 = {
|
|
53
|
+
ib: binIb,
|
|
54
|
+
data: dataBuffer,
|
|
55
|
+
};
|
|
56
|
+
binIbGib.gib = await getGib({ ibGib: binIbGib, hasTjp: false });
|
|
57
|
+
const binAddr = getIbGibAddr({ ibGib: binIbGib });
|
|
58
|
+
|
|
59
|
+
await putInSpace({ ibGib: binIbGib, space });
|
|
60
|
+
await registerNewIbGib({ ibGib: binIbGib, space });
|
|
61
|
+
|
|
62
|
+
const itemRes = await createB2tFSItemIbGib({
|
|
63
|
+
fsType: 'file',
|
|
64
|
+
name,
|
|
65
|
+
data: {
|
|
66
|
+
fileHash,
|
|
67
|
+
},
|
|
68
|
+
rel8ns: {
|
|
69
|
+
[BINARY_REL8N_NAME]: [binAddr],
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await persistTransformResult({ resTransform: itemRes, space });
|
|
74
|
+
await registerNewIbGib({ ibGib: itemRes.newIbGib, space });
|
|
75
|
+
|
|
76
|
+
return itemRes.newIbGib as B2tFSItemIbGib_V1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
await respecfully(lc, `WebInMemoryWorkspaceProjectionSpace_V1 Specs`, async () => {
|
|
80
|
+
|
|
81
|
+
let backingSpace: InnerSpace_V1;
|
|
82
|
+
let wsSpace: WebInMemoryWorkspaceProjectionSpace_V1;
|
|
83
|
+
|
|
84
|
+
firstOfEach(lc, async () => {
|
|
85
|
+
backingSpace = new InnerSpace_V1({
|
|
86
|
+
...DEFAULT_INNER_SPACE_DATA_V1,
|
|
87
|
+
name: 'b2s_main',
|
|
88
|
+
uuid: 'test_backing_uuid_1',
|
|
89
|
+
});
|
|
90
|
+
await backingSpace.initialized;
|
|
91
|
+
|
|
92
|
+
wsSpace = new WebInMemoryWorkspaceProjectionSpace_V1({
|
|
93
|
+
initialData: {
|
|
94
|
+
name: 'test_in_memory_ws',
|
|
95
|
+
uuid: 'ws_uuid_1',
|
|
96
|
+
workspaceRoot: '/',
|
|
97
|
+
vcsFolderName: '.vcsgib',
|
|
98
|
+
},
|
|
99
|
+
backingSpace,
|
|
100
|
+
});
|
|
101
|
+
await wsSpace.initialized;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
await respecfully(lc, `Reification into In-Memory Virtual Tree`, async () => {
|
|
105
|
+
await ifWeMight(lc, `reifies file and folder hierarchies into virtual file map`, async () => {
|
|
106
|
+
const file1 = await createFileWithContent({ name: 'main.ts', content: 'console.log("hello");', space: backingSpace });
|
|
107
|
+
const file1Addr = getIbGibAddr({ ibGib: file1 });
|
|
108
|
+
|
|
109
|
+
const file2 = await createFileWithContent({ name: 'helper.ts', content: 'export const x = 42;', space: backingSpace });
|
|
110
|
+
const file2Addr = getIbGibAddr({ ibGib: file2 });
|
|
111
|
+
|
|
112
|
+
const srcFolderRes = await createB2tFSItemIbGib({
|
|
113
|
+
fsType: 'folder',
|
|
114
|
+
name: 'src',
|
|
115
|
+
rel8ns: {
|
|
116
|
+
b2tfs_child: [file1Addr, file2Addr],
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
await persistTransformResult({ resTransform: srcFolderRes, space: backingSpace });
|
|
120
|
+
const srcFolder = srcFolderRes.newIbGib as B2tFSItemIbGib_V1;
|
|
121
|
+
const srcFolderAddr = getIbGibAddr({ ibGib: srcFolder });
|
|
122
|
+
|
|
123
|
+
const readmeFile = await createFileWithContent({ name: 'README.md', content: '# Project Docs', space: backingSpace });
|
|
124
|
+
const readmeAddr = getIbGibAddr({ ibGib: readmeFile });
|
|
125
|
+
|
|
126
|
+
const rootFolderRes = await createB2tFSItemIbGib({
|
|
127
|
+
fsType: 'folder',
|
|
128
|
+
name: 'my-repo',
|
|
129
|
+
rel8ns: {
|
|
130
|
+
b2tfs_child: [srcFolderAddr, readmeAddr],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
await persistTransformResult({ resTransform: rootFolderRes, space: backingSpace });
|
|
134
|
+
const rootFolder = rootFolderRes.newIbGib as B2tFSItemIbGib_V1;
|
|
135
|
+
|
|
136
|
+
// Reify into projection space
|
|
137
|
+
await putInSpace({ ibGib: rootFolder, space: wsSpace });
|
|
138
|
+
|
|
139
|
+
// Verify virtual tree
|
|
140
|
+
const paths = wsSpace.listVirtualPaths();
|
|
141
|
+
iReckon(lc, paths).includes('src');
|
|
142
|
+
iReckon(lc, paths).includes('src/main.ts');
|
|
143
|
+
iReckon(lc, paths).includes('src/helper.ts');
|
|
144
|
+
iReckon(lc, paths).includes('README.md');
|
|
145
|
+
|
|
146
|
+
const mainText = wsSpace.getVirtualText('src/main.ts');
|
|
147
|
+
iReckon(lc, mainText).willEqual('console.log("hello");');
|
|
148
|
+
|
|
149
|
+
const readmeText = wsSpace.getVirtualText('README.md');
|
|
150
|
+
iReckon(lc, readmeText).willEqual('# Project Docs');
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
await respecfully(lc, `Virtual Workspace Scan & Observation`, async () => {
|
|
155
|
+
await ifWeMight(lc, `scans virtual files, computes sha256 hashes, and extracts companion comments`, async () => {
|
|
156
|
+
// Set up virtual files directly
|
|
157
|
+
wsSpace.setVirtualFile('src/index.ts', 'const a = 1;');
|
|
158
|
+
wsSpace.setVirtualFile('src/.ib.index.ts.md', '# Note on index.ts\nThis is a companion note.');
|
|
159
|
+
wsSpace.setVirtualFile('docs/guide.md', '# Guide');
|
|
160
|
+
wsSpace.setVirtualFile('node_modules/pkg/index.js', 'module.exports = {};');
|
|
161
|
+
wsSpace.setVirtualFile('debug.log', 'test log');
|
|
162
|
+
wsSpace.setVirtualFile('.ibgibignore', 'node_modules/\n*.log\n!important.log');
|
|
163
|
+
wsSpace.setVirtualFile('important.log', 'keep this log');
|
|
164
|
+
|
|
165
|
+
const resWitness = await wsSpace.witness({
|
|
166
|
+
ib: wsSpace.ib,
|
|
167
|
+
data: {
|
|
168
|
+
cmd: 'get',
|
|
169
|
+
cmdModifiers: [CMD_MODIFIER_WORKSPACE_SCAN],
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
iReckon(lc, resWitness?.data?.success).isGonnaBeTrue();
|
|
174
|
+
const scanData = resWitness?.data?.scanResult;
|
|
175
|
+
iReckon(lc, scanData).isGonnaBeTruthy();
|
|
176
|
+
|
|
177
|
+
const files = scanData!.files;
|
|
178
|
+
iReckon(lc, files.has('src/index.ts')).isGonnaBeTrue();
|
|
179
|
+
iReckon(lc, files.has('docs/guide.md')).isGonnaBeTrue();
|
|
180
|
+
iReckon(lc, files.has('important.log')).isGonnaBeTrue();
|
|
181
|
+
|
|
182
|
+
// Filtered files
|
|
183
|
+
iReckon(lc, files.has('node_modules/pkg/index.js')).isGonnaBeFalse();
|
|
184
|
+
iReckon(lc, files.has('debug.log')).isGonnaBeFalse();
|
|
185
|
+
|
|
186
|
+
// File hash verification
|
|
187
|
+
const msgBytes = new TextEncoder().encode('const a = 1;');
|
|
188
|
+
const digestBuf = await crypto.subtle.digest('SHA-256', msgBytes.buffer as ArrayBuffer);
|
|
189
|
+
const expectedHash = Array.from(new Uint8Array(digestBuf)).map(b => b.toString(16).padStart(2, '0')).join('');
|
|
190
|
+
iReckon(lc, files.get('src/index.ts')?.fileHash).willEqual(expectedHash);
|
|
191
|
+
|
|
192
|
+
// Pending comments
|
|
193
|
+
const comments = scanData!.pendingComments;
|
|
194
|
+
iReckon(lc, comments.length).willEqual(1);
|
|
195
|
+
iReckon(lc, comments[0].topicName).willEqual('index.ts');
|
|
196
|
+
iReckon(lc, comments[0].targetRelPath).willEqual('src/index.ts');
|
|
197
|
+
iReckon(lc, comments[0].content).includes('Note on index.ts');
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
await respecfully(lc, `Isomorphic getRepoStatus with WebInMemoryWorkspaceProjectionSpace`, async () => {
|
|
202
|
+
await ifWeMight(lc, `detects untracked, modified, and deleted files in virtual workspace`, async () => {
|
|
203
|
+
const trackedFile = await createFileWithContent({ name: 'app.ts', content: 'version 1', space: backingSpace });
|
|
204
|
+
const trackedAddr = getIbGibAddr({ ibGib: trackedFile });
|
|
205
|
+
|
|
206
|
+
const rootFolderRes = await createB2tFSItemIbGib({
|
|
207
|
+
fsType: 'folder',
|
|
208
|
+
name: 'repo',
|
|
209
|
+
rel8ns: {
|
|
210
|
+
b2tfs_child: [trackedAddr],
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
await persistTransformResult({ resTransform: rootFolderRes, space: backingSpace });
|
|
214
|
+
const rootFolder = rootFolderRes.newIbGib as B2tFSItemIbGib_V1;
|
|
215
|
+
const rootFolderAddr = getIbGibAddr({ ibGib: rootFolder });
|
|
216
|
+
|
|
217
|
+
// Create branch ibgib in backingSpace
|
|
218
|
+
const branchIbGib: B2tFSBranchIbGib_V1 = {
|
|
219
|
+
ib: 'b2tfs_branch main',
|
|
220
|
+
data: {
|
|
221
|
+
name: 'main',
|
|
222
|
+
uuid: 'main_branch_uuid',
|
|
223
|
+
},
|
|
224
|
+
rel8ns: {
|
|
225
|
+
b2tfs_item: [rootFolderAddr],
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
branchIbGib.gib = await getGib({ ibGib: branchIbGib, hasTjp: false });
|
|
229
|
+
const branchAddr = getIbGibAddr({ ibGib: branchIbGib });
|
|
230
|
+
await putInSpace({ ibGib: branchIbGib, space: backingSpace });
|
|
231
|
+
await registerNewIbGib({ ibGib: branchIbGib, space: backingSpace });
|
|
232
|
+
|
|
233
|
+
// Reify into virtual space
|
|
234
|
+
await putInSpace({ ibGib: rootFolder, space: wsSpace });
|
|
235
|
+
|
|
236
|
+
const mockMetaspace = {
|
|
237
|
+
getLocalUserSpaces: async () => [backingSpace],
|
|
238
|
+
registerNewIbGib: async ({ ibGib }: { ibGib: any }) => {
|
|
239
|
+
await putInSpace({ ibGib, space: backingSpace });
|
|
240
|
+
},
|
|
241
|
+
} as any;
|
|
242
|
+
|
|
243
|
+
// Create index in backingSpace with unstaged working tree
|
|
244
|
+
let indexIbGib = await createB2tFSIndexIbGib({
|
|
245
|
+
// spaceId: getSpaceIdFromIb(backingSpace.ib) || 'test_backing_uuid_1',
|
|
246
|
+
activeSpaceId: backingSpace.data?.uuid || 'test_backing_uuid_1',
|
|
247
|
+
activeBranchName: 'main',
|
|
248
|
+
branchAddr,
|
|
249
|
+
space: backingSpace,
|
|
250
|
+
metaspace: mockMetaspace,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// 1. Initial status: clean
|
|
254
|
+
let status = await getRepoStatus({
|
|
255
|
+
metaspace: mockMetaspace,
|
|
256
|
+
localSpace: backingSpace,
|
|
257
|
+
workspaceSpace: wsSpace,
|
|
258
|
+
indexIbGib,
|
|
259
|
+
});
|
|
260
|
+
iReckon(lc, status.untracked.length).willEqual(0);
|
|
261
|
+
iReckon(lc, status.modified.length).willEqual(0);
|
|
262
|
+
iReckon(lc, status.deleted.length).willEqual(0);
|
|
263
|
+
|
|
264
|
+
// 2. Modify app.ts in virtual space
|
|
265
|
+
wsSpace.setVirtualFile('app.ts', 'version 2 modified');
|
|
266
|
+
// 3. Add untracked new-file.ts in virtual space
|
|
267
|
+
wsSpace.setVirtualFile('new-file.ts', 'new content');
|
|
268
|
+
|
|
269
|
+
status = await getRepoStatus({
|
|
270
|
+
metaspace: mockMetaspace,
|
|
271
|
+
localSpace: backingSpace,
|
|
272
|
+
workspaceSpace: wsSpace,
|
|
273
|
+
indexIbGib,
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const modPaths = status.modified.map(m => m.path);
|
|
277
|
+
const untrackedPaths = status.untracked.map(u => u.path);
|
|
278
|
+
iReckon(lc, modPaths).includes('app.ts');
|
|
279
|
+
iReckon(lc, untrackedPaths).includes('new-file.ts');
|
|
280
|
+
|
|
281
|
+
// 4. Delete app.ts from virtual space
|
|
282
|
+
await wsSpace.witness({
|
|
283
|
+
ib: wsSpace.ib,
|
|
284
|
+
data: {
|
|
285
|
+
cmd: 'delete',
|
|
286
|
+
},
|
|
287
|
+
ibGibs: [{
|
|
288
|
+
ib: 'item',
|
|
289
|
+
data: { name: 'app.ts' },
|
|
290
|
+
} as any],
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
status = await getRepoStatus({
|
|
294
|
+
metaspace: mockMetaspace,
|
|
295
|
+
localSpace: backingSpace,
|
|
296
|
+
workspaceSpace: wsSpace,
|
|
297
|
+
indexIbGib,
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const delPaths = status.deleted.map(d => d.path);
|
|
301
|
+
iReckon(lc, delPaths).includes('app.ts');
|
|
302
|
+
iReckon(lc, status.untracked.map(u => u.path)).includes('new-file.ts');
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
});
|
|
@@ -1,43 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ibgib-create-app
|
|
3
|
-
description: The
|
|
3
|
+
description: The Master Coordinator skill for scaffolding complete ibgib applications. Prompts for topology archetype (Full-Stack, Client-Only SPA, Browser Extension, or Server-Only) and workspace context, then orchestrates client and server sub-skills.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# ibgib-create-app
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- `
|
|
25
|
-
|
|
26
|
-
- `
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
6
|
+
# Skill: ibgib-create-app (Master Coordinator)
|
|
7
|
+
|
|
8
|
+
## What This Skill Does
|
|
9
|
+
|
|
10
|
+
This is the **Master Coordinator Skill** for scaffolding applications in the `ibgib` ecosystem. It evaluates the desired application topology and orchestrates the appropriate sub-skills to produce a buildable, type-safe, and consistent application.
|
|
11
|
+
|
|
12
|
+
For complete architectural background, refer to:
|
|
13
|
+
* **The App Guide**: [`docs/CREATING_IBGIB_APPS_GUIDE.md`](../../../docs/CREATING_IBGIB_APPS_GUIDE.md)
|
|
14
|
+
* **The Client Guide**: [`docs/IBGIB_CLIENT_APPS_GUIDE.md`](../../../docs/IBGIB_CLIENT_APPS_GUIDE.md)
|
|
15
|
+
* **The Server Guide**: [`docs/IBGIB_SERVER_APPS_GUIDE.md`](../../../docs/IBGIB_SERVER_APPS_GUIDE.md)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Topology Archetypes
|
|
20
|
+
|
|
21
|
+
Before scaffolding, confirm the target topology with the developer:
|
|
22
|
+
|
|
23
|
+
1. **`fullstack`** (e.g. `space-gib` style):
|
|
24
|
+
* SPA Client (`src/client`) + Node `serve-gib` Server (`src/server`) + Shared Types (`src/common`).
|
|
25
|
+
* Containerized via Docker Compose & Traefik.
|
|
26
|
+
* *Sub-skills used*: `ibgib-create-client-app` + `ibgib-create-server-app`.
|
|
27
|
+
2. **`client-only-spa`**:
|
|
28
|
+
* Standalone in-browser SPA utilizing IndexedDB space and syncing to a remote ibgib Hub.
|
|
29
|
+
* *Sub-skills used*: `ibgib-create-client-app`.
|
|
30
|
+
3. **`browser-extension`** (e.g. `blank-gib` style):
|
|
31
|
+
* Manifest v3 extension with background worker and popup UI.
|
|
32
|
+
* *Sub-skills used*: `ibgib-create-client-app`.
|
|
33
|
+
4. **`server-only`**:
|
|
34
|
+
* Dedicated Space & Identity Hub or custom API service.
|
|
35
|
+
* *Sub-skills used*: `ibgib-create-server-app`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Workspace Context
|
|
40
|
+
|
|
41
|
+
Confirm the target workspace mode:
|
|
42
|
+
* **`monorepo`** (Default): App is created within the `apps/` directory of this monorepo or a downstream monorepo clone. Uses monorepo workspace links (`@ibgib/*: "*"`) and extends `../../tsconfig.base.json`.
|
|
43
|
+
* **`standalone`**: App is an independent single-package repository consuming published npm packages.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Coordinated Sub-Skills
|
|
48
|
+
|
|
49
|
+
* **`ibgib-create-client-app`**: Coordinates client core bootstrap, app witness, UI shell, components, and Keystone identity wiring.
|
|
50
|
+
* $\hookrightarrow$ `ibgib-create-client-app-core`
|
|
51
|
+
* $\hookrightarrow$ `ibgib-create-client-app-witness`
|
|
52
|
+
* $\hookrightarrow$ `ibgib-create-client-shell`
|
|
53
|
+
* $\hookrightarrow$ `ibgib-create-client-identity`
|
|
54
|
+
* $\hookrightarrow$ `ibgib-create-component`
|
|
55
|
+
* **`ibgib-create-server-app`**: Scaffolds the Node `serve-gib` backend runner, `tsconfig.server.json`, `Dockerfile`, and `docker-compose.yml`.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Master Scaffolding Workflow
|
|
60
|
+
|
|
61
|
+
1. **Gather Tokens**: Confirm application names, paths, ports, and generate UUIDs using:
|
|
62
|
+
```bash
|
|
63
|
+
node .agents/skills/ibgib-create-client-app-core/generate-id.js
|
|
64
|
+
```
|
|
65
|
+
2. **Scaffold Client**: If archetype is `fullstack`, `client-only-spa`, or `browser-extension`, invoke **`ibgib-create-client-app`**.
|
|
66
|
+
3. **Scaffold Server**: If archetype is `fullstack` or `server-only`, invoke **`ibgib-create-server-app`**.
|
|
67
|
+
4. **Wire Build Pipeline**:
|
|
68
|
+
* For monorepo apps: Add `build-[app-name].mts` in `build/src/concrete-build/` and add npm scripts to root `package.json`.
|
|
69
|
+
* For standalone apps: Verify local `package.json` build and watch scripts.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ibgib-create-client-app
|
|
3
|
+
description: Coordinator skill for scaffolding an ibgib client application (SPA, browser extension, or client frontend of a fullstack project).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: ibgib-create-client-app
|
|
7
|
+
|
|
8
|
+
## What This Skill Does
|
|
9
|
+
|
|
10
|
+
Coordinates the modular sub-skills required to scaffold a fully functional, type-safe, and buildable `ibgib` client application.
|
|
11
|
+
|
|
12
|
+
For architectural foundations, refer to [`docs/IBGIB_CLIENT_APPS_GUIDE.md`](../../../docs/IBGIB_CLIENT_APPS_GUIDE.md).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Coordinated Sub-Skills
|
|
17
|
+
|
|
18
|
+
1. **`ibgib-create-client-app-core`**: Foundation (Three-tier Bootstrap, Metaspace, Local IndexedDB Storage, Types).
|
|
19
|
+
2. **`ibgib-create-client-app-witness`**: Domain Logic (App Witness class, commands, helpers).
|
|
20
|
+
3. **`ibgib-create-client-shell`**: UI Shell (Shell service, window event listeners).
|
|
21
|
+
4. **`ibgib-create-component`**: Main Application Web Component.
|
|
22
|
+
5. **`ibgib-create-client-identity`**: Keystone Identity Components & Remote Hub Sync wiring.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Parameters (Shared Tokens)
|
|
27
|
+
|
|
28
|
+
Confirm or generate these tokens:
|
|
29
|
+
- `{{APP_NAME}}`: kebab-case (e.g. `my-app`)
|
|
30
|
+
- `{{APP_DIR_NAME}}`: folder name (e.g. `my-app`)
|
|
31
|
+
- `{{APP_CLASSNAME_PREFIX}}`: PascalCase (e.g. `MyApp`)
|
|
32
|
+
- `{{APP_CLASSNAME}}`: Full class name (e.g. `MyAppApp_V1`)
|
|
33
|
+
- `{{APP_HUMAN_NAME}}`: Natural language (e.g. `My App`)
|
|
34
|
+
- `{{APP_VAR_NAME}}`: camelCase (e.g. `myApp`)
|
|
35
|
+
- `{{APP_NAME_UPPER}}`: SCREAMING_SNAKE_CASE (e.g. `MY_APP`)
|
|
36
|
+
- `{{DB_NAME}}`: IndexedDB name (e.g. `my_app_db`)
|
|
37
|
+
- `{{APP_UUID}}`: Generated fresh via `node .agents/skills/ibgib-create-client-app-core/generate-id.js`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Workflow for Greenfield (Fresh Client App)
|
|
42
|
+
|
|
43
|
+
1. **Prepare Tokens**: Generate fresh `{{APP_UUID}}` and confirm tokens.
|
|
44
|
+
2. **Core Engine**: Call `ibgib-create-client-app-core` to scaffold foundational bootstrap files.
|
|
45
|
+
3. **App Witness**: Call `ibgib-create-client-app-witness` to scaffold domain logic.
|
|
46
|
+
4. **UI Shell**: Call `ibgib-create-client-shell` to scaffold the shell service.
|
|
47
|
+
5. **Main Component**: Call `ibgib-create-component` to create the initial app view.
|
|
48
|
+
6. **Identity Wiring**: Call `ibgib-create-client-identity` to register Keystone identity components.
|
|
49
|
+
7. **Hook Up**:
|
|
50
|
+
- Verify `bootstrap.mts` invokes shell `onEngineReady()` and registers identity components.
|
|
51
|
+
- Configure build script (`build-[app].mts` in monorepo, or local build script if standalone).
|
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: ibgib-create-app-core
|
|
2
|
+
name: ibgib-create-client-app-core
|
|
3
3
|
description: >
|
|
4
|
-
Scaffolds the foundational ibgib bootstrap flow and global state management.
|
|
4
|
+
Scaffolds the foundational ibgib client bootstrap flow and global state management.
|
|
5
5
|
Generates the 8 foundational files (index.html, index.mts, script.mts,
|
|
6
6
|
bootstrap.mts, constants.mts, types.mts, helpers.web.mts, and style.css)
|
|
7
|
-
required for an ibgib app to boot. Supports both greenfield and brownfield projects.
|
|
7
|
+
required for an ibgib client app to boot. Supports both greenfield and brownfield projects.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# Skill: ibgib-create-app-core
|
|
10
|
+
# Skill: ibgib-create-client-app-core
|
|
11
11
|
|
|
12
12
|
## What This Skill Does
|
|
13
13
|
|
|
14
|
-
Generates the engineering foundation for an ibgib
|
|
14
|
+
Generates the engineering foundation for an `ibgib` client application (SPA, browser extension, or client frontend of a full-stack project). This includes:
|
|
15
15
|
- **Global State**: Wiring `globalThis.ibgib` with the appropriate app-specific sub-objects.
|
|
16
|
-
- **Bootstrap
|
|
16
|
+
- **Three-Tier Bootstrap Flow**:
|
|
17
|
+
1. `Metaspace`: Initializes the runtime environment and event bus.
|
|
18
|
+
2. `Local Space`: Boots the persistent `IndexedDB` local user storage.
|
|
19
|
+
3. `App Witness`: Prepares the engine for loading the domain logic witness.
|
|
17
20
|
- **Storage**: Initializing IndexedDB spaces.
|
|
18
21
|
- **Types & Helpers**: Providing the basic framework for identity and witness coordination.
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
For the complete architectural guide, refer to [`docs/IBGIB_CLIENT_APPS_GUIDE.md`](../../../docs/IBGIB_CLIENT_APPS_GUIDE.md).
|
|
24
|
+
|
|
25
|
+
> [!NOTE]
|
|
26
|
+
> This skill does NOT generate the App Witness (the business logic), UI Shell, or Identity wiring; use `ibgib-create-client-app-witness`, `ibgib-create-client-shell`, and `ibgib-create-client-identity` for those.
|
|
21
27
|
|
|
22
28
|
---
|
|
23
29
|
|
|
24
30
|
## Pre-Requisites (check before running)
|
|
25
31
|
|
|
26
32
|
1. Confirm the target directory exists or ask where to create files.
|
|
27
|
-
2. Verify that `@ibgib/ts-gib`, `@ibgib/helper-gib`, `@ibgib/core-gib`, and
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
one is needed. Create the `generate-version-file.js` if needed and incorporate in the prebuild script.
|
|
31
|
-
* the source for this that you can copy is at `.agents/skills/ibgib-create-app-core/generate-version-file.js`
|
|
33
|
+
2. Verify that `@ibgib/ts-gib`, `@ibgib/helper-gib`, `@ibgib/core-gib`, and `@ibgib/web-gib` are available in the workspace.
|
|
34
|
+
3. Confirm the project has an `AUTO-GENERATED-version.mts` file, or note that one is needed. Create the `generate-version-file.js` if needed and incorporate in the prebuild script.
|
|
35
|
+
* the source for this that you can copy is at `.agents/skills/ibgib-create-client-app-core/generate-version-file.js`
|
|
32
36
|
|
|
33
37
|
---
|
|
34
38
|
|
|
@@ -53,23 +57,23 @@ This skill is often the first step in creating a new app, or used to "ibgib-ify"
|
|
|
53
57
|
Derive tokens from the developer's answers. Generate a fresh `{{APP_UUID}}` using:
|
|
54
58
|
|
|
55
59
|
```bash
|
|
56
|
-
node .agents/skills/ibgib-create-app-core/generate-id.js
|
|
60
|
+
node .agents/skills/ibgib-create-client-app-core/generate-id.js
|
|
57
61
|
```
|
|
58
62
|
|
|
59
63
|
### 2. Generate all files
|
|
60
64
|
|
|
61
|
-
Apply token substitutions to templates in `templates/` and write to the target directory (`src/`
|
|
65
|
+
Apply token substitutions to templates in `templates/` and write to the target directory (`src/` or `src/client/`).
|
|
62
66
|
|
|
63
67
|
| Template file | Output file |
|
|
64
68
|
|---|---|
|
|
65
|
-
| templates/index.html.template | `index.html` |
|
|
66
|
-
| templates/index.mts.template | `index.mts` |
|
|
67
|
-
| templates/script.mts.template | `script.mts` |
|
|
68
|
-
| templates/bootstrap.mts.template | `bootstrap.mts` |
|
|
69
|
-
| templates/constants.mts.template | `constants.mts` |
|
|
70
|
-
| templates/types.mts.template | `types.mts` |
|
|
71
|
-
| templates/helpers.web.mts.template | `helpers.web.mts` |
|
|
72
|
-
| templates/style.css.template | `style.css` (if missing) |
|
|
69
|
+
| `templates/index.html.template` | `index.html` |
|
|
70
|
+
| `templates/index.mts.template` | `index.mts` |
|
|
71
|
+
| `templates/script.mts.template` | `script.mts` |
|
|
72
|
+
| `templates/bootstrap.mts.template` | `bootstrap.mts` |
|
|
73
|
+
| `templates/constants.mts.template` | `constants.mts` |
|
|
74
|
+
| `templates/types.mts.template` | `types.mts` |
|
|
75
|
+
| `templates/helpers.web.mts.template` | `helpers.web.mts` |
|
|
76
|
+
| `templates/style.css.template` | `style.css` (if missing) |
|
|
73
77
|
|
|
74
78
|
### 3. Replace `genuuid` placeholders
|
|
75
79
|
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: ibgib-create-app-witness
|
|
2
|
+
name: ibgib-create-client-app-witness
|
|
3
3
|
description: >
|
|
4
|
-
Scaffolds the App Witness (engine)
|
|
4
|
+
Scaffolds the App Witness (domain logic engine) for an ibgib client application.
|
|
5
5
|
Generates the core business logic files including the App class,
|
|
6
6
|
constants, helpers, and types.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Skill: ibgib-create-app-witness
|
|
9
|
+
# Skill: ibgib-create-client-app-witness
|
|
10
10
|
|
|
11
11
|
## What This Skill Does
|
|
12
12
|
|
|
13
|
-
An ibgib alone is a data description. A "witness" is a class that provides behavior that wraps this ibgib data shape via a single function with the following basic shape: `witness(arg: IbGib_V1): Promise<IbGib_V1>`. So a witness provides a single binding point that takes in an ibgib and returns one.
|
|
13
|
+
An ibgib alone is a data description. A "witness" is a class that provides behavior that wraps this ibgib data shape via a single function with the following basic shape: `witness(arg: IbGib_V1): Promise<IbGib_V1>`. So a witness provides a single binding point that takes in an ibgib and returns one.
|
|
14
|
+
|
|
15
|
+
This skill generates the domain "Brain" (App Witness) of an `ibgib` client app that implements this interface. Concretely, the generated app witness class adds plumbing for parsing incoming comments (commands) sent by the user or other agents. A web app defaults to a single configuration/comment (`--interactive`), but this can be extended to have features enabled/disabled per context.
|
|
14
16
|
|
|
15
17
|
This skill scaffolds:
|
|
16
18
|
- **App Class**: Inherits from `AppBase_V1` and handles the initial `--interactive` request to boot the app.
|
|
17
19
|
- **App Constants**: Defines `PARAM_INFOS` and the app's internal command set.
|
|
18
|
-
- **App Helpers**:
|
|
20
|
+
- **App Helpers**: Boilerplate for creating request comments and validating parameters.
|
|
19
21
|
- **App Types**: Data and Relationship structures unique to this app.
|
|
20
22
|
- **API Registration**: Plumbing to register core app functions with the ibgib runtime.
|
|
21
23
|
|
|
24
|
+
For complete architectural context, refer to [`docs/IBGIB_CLIENT_APPS_GUIDE.md`](../../../docs/IBGIB_CLIENT_APPS_GUIDE.md).
|
|
25
|
+
|
|
22
26
|
---
|
|
23
27
|
|
|
24
28
|
## Token Reference
|
|
@@ -36,10 +40,10 @@ This skill scaffolds:
|
|
|
36
40
|
## Generation Steps
|
|
37
41
|
|
|
38
42
|
### 1. Confirm Tokens
|
|
39
|
-
Ensure you have the same tokens used in `ibgib-create-app-core`.
|
|
43
|
+
Ensure you have the same tokens used in `ibgib-create-client-app-core`.
|
|
40
44
|
|
|
41
45
|
### 2. Generate Files
|
|
42
|
-
Apply substitutions to templates and write to the target directory (usually `src/`).
|
|
46
|
+
Apply substitutions to templates and write to the target directory (usually `src/` or `src/client/`).
|
|
43
47
|
|
|
44
48
|
| Template file | Output file |
|
|
45
49
|
|---|---|
|