@ontrails/trails 1.0.0-beta.14 → 1.0.0-beta.15
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/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +13 -0
- package/__tests__/examples.test.ts +29 -4
- package/dist/src/app.js +2 -2
- package/dist/src/app.js.map +1 -1
- package/dist/src/clack.d.ts +1 -1
- package/dist/src/clack.js +1 -1
- package/dist/src/cli.js +4 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/trails/add-surface.d.ts +3 -3
- package/dist/src/trails/add-surface.d.ts.map +1 -1
- package/dist/src/trails/add-surface.js +46 -24
- package/dist/src/trails/add-surface.js.map +1 -1
- package/dist/src/trails/add-trail.d.ts +3 -1
- package/dist/src/trails/add-trail.d.ts.map +1 -1
- package/dist/src/trails/add-trail.js +38 -11
- package/dist/src/trails/add-trail.js.map +1 -1
- package/dist/src/trails/add-trailhead.d.ts +1 -1
- package/dist/src/trails/add-trailhead.d.ts.map +1 -1
- package/dist/src/trails/add-trailhead.js +4 -4
- package/dist/src/trails/add-verify.d.ts +1 -1
- package/dist/src/trails/add-verify.d.ts.map +1 -1
- package/dist/src/trails/add-verify.js +7 -6
- package/dist/src/trails/add-verify.js.map +1 -1
- package/dist/src/trails/create-scaffold.d.ts +1 -1
- package/dist/src/trails/create-scaffold.d.ts.map +1 -1
- package/dist/src/trails/create-scaffold.js +10 -3
- package/dist/src/trails/create-scaffold.js.map +1 -1
- package/dist/src/trails/create.d.ts +10 -14
- package/dist/src/trails/create.d.ts.map +1 -1
- package/dist/src/trails/create.js +42 -37
- package/dist/src/trails/create.js.map +1 -1
- package/dist/src/trails/dev-clean.d.ts +4 -4
- package/dist/src/trails/dev-clean.d.ts.map +1 -1
- package/dist/src/trails/dev-clean.js +22 -21
- package/dist/src/trails/dev-clean.js.map +1 -1
- package/dist/src/trails/dev-reset.d.ts +1 -1
- package/dist/src/trails/dev-reset.d.ts.map +1 -1
- package/dist/src/trails/dev-reset.js +3 -2
- package/dist/src/trails/dev-reset.js.map +1 -1
- package/dist/src/trails/dev-stats.d.ts +4 -4
- package/dist/src/trails/dev-stats.d.ts.map +1 -1
- package/dist/src/trails/dev-stats.js +19 -19
- package/dist/src/trails/dev-stats.js.map +1 -1
- package/dist/src/trails/dev-support.d.ts +17 -17
- package/dist/src/trails/dev-support.d.ts.map +1 -1
- package/dist/src/trails/dev-support.js +60 -57
- package/dist/src/trails/dev-support.js.map +1 -1
- package/dist/src/trails/draft-promote.d.ts +1 -1
- package/dist/src/trails/draft-promote.d.ts.map +1 -1
- package/dist/src/trails/draft-promote.js +30 -16
- package/dist/src/trails/draft-promote.js.map +1 -1
- package/dist/src/trails/guide.d.ts +2 -2
- package/dist/src/trails/guide.d.ts.map +1 -1
- package/dist/src/trails/guide.js +1 -4
- package/dist/src/trails/guide.js.map +1 -1
- package/dist/src/trails/load-app.d.ts +7 -1
- package/dist/src/trails/load-app.d.ts.map +1 -1
- package/dist/src/trails/load-app.js +374 -26
- package/dist/src/trails/load-app.js.map +1 -1
- package/dist/src/trails/survey.d.ts +5 -5
- package/dist/src/trails/survey.d.ts.map +1 -1
- package/dist/src/trails/survey.js +51 -29
- package/dist/src/trails/survey.js.map +1 -1
- package/dist/src/trails/topo-export.d.ts +5 -4
- package/dist/src/trails/topo-export.d.ts.map +1 -1
- package/dist/src/trails/topo-export.js +4 -7
- package/dist/src/trails/topo-export.js.map +1 -1
- package/dist/src/trails/topo-history.d.ts +6 -10
- package/dist/src/trails/topo-history.d.ts.map +1 -1
- package/dist/src/trails/topo-history.js +7 -8
- package/dist/src/trails/topo-history.js.map +1 -1
- package/dist/src/trails/topo-pin.d.ts +5 -9
- package/dist/src/trails/topo-pin.d.ts.map +1 -1
- package/dist/src/trails/topo-pin.js +5 -9
- package/dist/src/trails/topo-pin.js.map +1 -1
- package/dist/src/trails/topo-read-support.d.ts +12 -8
- package/dist/src/trails/topo-read-support.d.ts.map +1 -1
- package/dist/src/trails/topo-read-support.js +71 -82
- package/dist/src/trails/topo-read-support.js.map +1 -1
- package/dist/src/trails/topo-reports.d.ts +15 -11
- package/dist/src/trails/topo-reports.d.ts.map +1 -1
- package/dist/src/trails/topo-reports.js +40 -34
- package/dist/src/trails/topo-reports.js.map +1 -1
- package/dist/src/trails/topo-show.d.ts +4 -4
- package/dist/src/trails/topo-show.d.ts.map +1 -1
- package/dist/src/trails/topo-show.js +8 -12
- package/dist/src/trails/topo-show.js.map +1 -1
- package/dist/src/trails/topo-store-support.d.ts +2 -2
- package/dist/src/trails/topo-store-support.d.ts.map +1 -1
- package/dist/src/trails/topo-store-support.js +22 -22
- package/dist/src/trails/topo-store-support.js.map +1 -1
- package/dist/src/trails/topo-support.d.ts +19 -30
- package/dist/src/trails/topo-support.d.ts.map +1 -1
- package/dist/src/trails/topo-support.js +63 -96
- package/dist/src/trails/topo-support.js.map +1 -1
- package/dist/src/trails/topo-unpin.d.ts +9 -4
- package/dist/src/trails/topo-unpin.d.ts.map +1 -1
- package/dist/src/trails/topo-unpin.js +9 -4
- package/dist/src/trails/topo-unpin.js.map +1 -1
- package/dist/src/trails/topo-verify.d.ts +2 -2
- package/dist/src/trails/topo-verify.d.ts.map +1 -1
- package/dist/src/trails/topo-verify.js +1 -5
- package/dist/src/trails/topo-verify.js.map +1 -1
- package/dist/src/trails/topo.d.ts +2 -2
- package/dist/src/trails/topo.d.ts.map +1 -1
- package/dist/src/trails/topo.js +6 -10
- package/dist/src/trails/topo.js.map +1 -1
- package/dist/src/trails/warden.d.ts +3 -2
- package/dist/src/trails/warden.d.ts.map +1 -1
- package/dist/src/trails/warden.js +11 -2
- package/dist/src/trails/warden.js.map +1 -1
- package/dist/src/versions.d.ts +12 -0
- package/dist/src/versions.d.ts.map +1 -0
- package/dist/src/versions.js +23 -0
- package/dist/src/versions.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/__tests__/add-trail.test.ts +97 -0
- package/src/__tests__/create.test.ts +91 -27
- package/src/__tests__/guide.test.ts +10 -5
- package/src/__tests__/load-app.test.ts +365 -4
- package/src/__tests__/survey.test.ts +143 -67
- package/src/__tests__/topo-dev.test.ts +48 -46
- package/src/app.ts +2 -2
- package/src/clack.ts +1 -1
- package/src/cli.ts +4 -3
- package/src/trails/add-surface.ts +150 -0
- package/src/trails/add-trail.ts +46 -10
- package/src/trails/add-verify.ts +11 -6
- package/src/trails/create-scaffold.ts +16 -3
- package/src/trails/create.ts +76 -71
- package/src/trails/dev-clean.ts +25 -21
- package/src/trails/dev-reset.ts +3 -2
- package/src/trails/dev-stats.ts +22 -19
- package/src/trails/dev-support.ts +88 -86
- package/src/trails/draft-promote.ts +70 -35
- package/src/trails/guide.ts +1 -4
- package/src/trails/load-app.ts +511 -32
- package/src/trails/survey.ts +60 -35
- package/src/trails/topo-export.ts +5 -9
- package/src/trails/topo-history.ts +8 -10
- package/src/trails/topo-pin.ts +9 -13
- package/src/trails/topo-read-support.ts +103 -106
- package/src/trails/topo-reports.ts +54 -47
- package/src/trails/topo-show.ts +8 -12
- package/src/trails/topo-store-support.ts +36 -28
- package/src/trails/topo-support.ts +90 -134
- package/src/trails/topo-unpin.ts +11 -6
- package/src/trails/topo-verify.ts +1 -5
- package/src/trails/topo.ts +6 -10
- package/src/trails/warden.ts +12 -3
- package/src/versions.ts +43 -0
- package/tsconfig.tests.json +10 -0
- package/src/trails/add-trailhead.ts +0 -121
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `survey` trail -- Full topo introspection.
|
|
3
3
|
*
|
|
4
|
-
* Lists trails, shows detail for individual trails, generates
|
|
4
|
+
* Lists trails, shows detail for individual trails, generates surface maps,
|
|
5
5
|
* and diffs against previous versions.
|
|
6
6
|
*/
|
|
7
|
+
import { join } from 'node:path';
|
|
7
8
|
import { NotFoundError, Result, trail } from '@ontrails/core';
|
|
8
|
-
import {
|
|
9
|
+
import { deriveSurfaceMapDiff, deriveOpenApiSpec, deriveSurfaceMap, readSurfaceMap, } from '@ontrails/schema';
|
|
9
10
|
import { z } from 'zod';
|
|
10
|
-
import { loadApp } from './load-app.js';
|
|
11
|
+
import { loadApp, loadFreshAppLease } from './load-app.js';
|
|
11
12
|
import { buildCurrentTopoBrief, buildCurrentTopoDetail, buildCurrentTopoList, } from './topo-read-support.js';
|
|
12
13
|
import { exportCurrentTopo } from './topo-store-support.js';
|
|
13
|
-
export {
|
|
14
|
+
export { deriveBriefReport, deriveResourceDetail, deriveSurveyList, deriveTrailDetail, } from './topo-reports.js';
|
|
14
15
|
// ---------------------------------------------------------------------------
|
|
15
16
|
// Brief report (formerly scout)
|
|
16
17
|
// ---------------------------------------------------------------------------
|
|
@@ -20,13 +21,13 @@ const formatDiff = (diff) => ({
|
|
|
20
21
|
info: diff.info,
|
|
21
22
|
warnings: diff.warnings,
|
|
22
23
|
});
|
|
23
|
-
const buildSurveyDiff = async (app, breakingOnly) => {
|
|
24
|
-
const currentMap =
|
|
25
|
-
const previousMap = await
|
|
24
|
+
const buildSurveyDiff = async (app, rootDir, breakingOnly) => {
|
|
25
|
+
const currentMap = deriveSurfaceMap(app);
|
|
26
|
+
const previousMap = await readSurfaceMap({ dir: join(rootDir, '.trails') });
|
|
26
27
|
if (!previousMap) {
|
|
27
|
-
return Result.err(new NotFoundError('No
|
|
28
|
+
return Result.err(new NotFoundError('No saved surface map found. Run `trails topo export` first.'));
|
|
28
29
|
}
|
|
29
|
-
const diff =
|
|
30
|
+
const diff = deriveSurfaceMapDiff(previousMap, currentMap);
|
|
30
31
|
return Result.ok(breakingOnly
|
|
31
32
|
? formatDiff({
|
|
32
33
|
...diff,
|
|
@@ -41,7 +42,7 @@ const buildSurveyDetail = (app, trailId, rootDir) => {
|
|
|
41
42
|
if (detail !== undefined) {
|
|
42
43
|
return Result.ok(detail);
|
|
43
44
|
}
|
|
44
|
-
return Result.err(new NotFoundError(`Trail or
|
|
45
|
+
return Result.err(new NotFoundError(`Trail or resource not found: ${trailId}`));
|
|
45
46
|
};
|
|
46
47
|
const buildSurveyGenerate = async (app, rootDir) => {
|
|
47
48
|
const exported = await exportCurrentTopo(app, { rootDir });
|
|
@@ -57,25 +58,25 @@ const buildSurveyGenerate = async (app, rootDir) => {
|
|
|
57
58
|
/** Ordered mode checks — first truthy predicate wins, otherwise 'list'. */
|
|
58
59
|
const modeChecks = [
|
|
59
60
|
[(i) => i.brief, 'brief'],
|
|
60
|
-
[(i) =>
|
|
61
|
+
[(i) => i.diffSaved, 'diff'],
|
|
61
62
|
[(i) => Boolean(i.trailId), 'detail'],
|
|
62
63
|
[(i) => i.generate, 'generate'],
|
|
63
64
|
[(i) => i.openapi, 'openapi'],
|
|
64
65
|
];
|
|
65
66
|
/** Determine which survey mode was requested, falling back to 'list'. */
|
|
66
|
-
const
|
|
67
|
+
const deriveSurveyMode = (input) => modeChecks.find(([predicate]) => predicate(input))?.[1] ?? 'list';
|
|
67
68
|
/** Handlers keyed by survey mode. */
|
|
68
69
|
const surveyHandlers = {
|
|
69
70
|
brief: (app, _input, rootDir) => Result.ok(buildCurrentTopoBrief(app, { rootDir })),
|
|
70
71
|
detail: (app, input, rootDir) => buildSurveyDetail(app, input.trailId ?? '', rootDir),
|
|
71
|
-
diff: (app, input) => buildSurveyDiff(app, input.breakingOnly),
|
|
72
|
+
diff: (app, input, rootDir) => buildSurveyDiff(app, rootDir, input.breakingOnly),
|
|
72
73
|
generate: (app, _input, rootDir) => buildSurveyGenerate(app, rootDir),
|
|
73
74
|
list: (app, _input, rootDir) => Result.ok(buildCurrentTopoList(app, { rootDir })),
|
|
74
|
-
openapi: (app) => Result.ok(
|
|
75
|
+
openapi: (app) => Result.ok(deriveOpenApiSpec(app)),
|
|
75
76
|
};
|
|
76
77
|
/** Dispatch to the appropriate survey sub-command based on input flags. */
|
|
77
78
|
const dispatchSurvey = (app, input, rootDir) => {
|
|
78
|
-
const mode =
|
|
79
|
+
const mode = deriveSurveyMode(input);
|
|
79
80
|
const handler = surveyHandlers[mode];
|
|
80
81
|
return handler(app, input, rootDir);
|
|
81
82
|
};
|
|
@@ -85,13 +86,34 @@ const dispatchSurvey = (app, input, rootDir) => {
|
|
|
85
86
|
export const surveyTrail = trail('survey', {
|
|
86
87
|
blaze: async (input, ctx) => {
|
|
87
88
|
const rootDir = ctx.cwd ?? '.';
|
|
89
|
+
const mode = deriveSurveyMode(input);
|
|
90
|
+
// Fresh load only for diffSaved: comparing against a previously-saved
|
|
91
|
+
// surface map requires the current app's source state, not any cached
|
|
92
|
+
// module graph that a prior import may have frozen. Other modes read
|
|
93
|
+
// the in-memory topo and benefit from the standard import cache.
|
|
94
|
+
//
|
|
95
|
+
// For diff specifically, use a disposable lease rather than retained
|
|
96
|
+
// fresh mirrors — the returned diff result is serialisable data, not
|
|
97
|
+
// a Topo reference with deferred imports, so the mirror can be
|
|
98
|
+
// released the moment dispatchSurvey returns. That keeps MCP/dev
|
|
99
|
+
// sessions that poll diff repeatedly from growing .trails-tmp/
|
|
100
|
+
// without bound.
|
|
101
|
+
if (mode === 'diff') {
|
|
102
|
+
const lease = await loadFreshAppLease(input.module, rootDir);
|
|
103
|
+
try {
|
|
104
|
+
return await dispatchSurvey(lease.app, input, rootDir);
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
lease.release();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
88
110
|
const app = await loadApp(input.module, rootDir);
|
|
89
111
|
return dispatchSurvey(app, input, rootDir);
|
|
90
112
|
},
|
|
91
113
|
description: 'Full topo introspection',
|
|
92
114
|
examples: [
|
|
93
115
|
{
|
|
94
|
-
description: 'Lists all registered trails with safety and
|
|
116
|
+
description: 'Lists all registered trails with safety and surface info',
|
|
95
117
|
input: { module: './src/app.ts' },
|
|
96
118
|
name: 'List all trails',
|
|
97
119
|
},
|
|
@@ -112,15 +134,15 @@ export const surveyTrail = trail('survey', {
|
|
|
112
134
|
.default(false)
|
|
113
135
|
.describe('Only show breaking changes'),
|
|
114
136
|
brief: z.boolean().default(false).describe('Quick capability summary'),
|
|
115
|
-
|
|
137
|
+
diffSaved: z
|
|
138
|
+
.boolean()
|
|
139
|
+
.default(false)
|
|
140
|
+
.describe('Diff against the saved local surface map'),
|
|
116
141
|
generate: z
|
|
117
142
|
.boolean()
|
|
118
143
|
.default(false)
|
|
119
|
-
.describe('Generate
|
|
120
|
-
module: z
|
|
121
|
-
.string()
|
|
122
|
-
.default('./src/app.ts')
|
|
123
|
-
.describe('Path to the app module'),
|
|
144
|
+
.describe('Generate surface map and lock file'),
|
|
145
|
+
module: z.string().optional().describe('Path to the app module'),
|
|
124
146
|
openapi: z.boolean().default(false).describe('Output OpenAPI 3.1 spec'),
|
|
125
147
|
trailId: z.string().optional().describe('Trail ID for detail view'),
|
|
126
148
|
}),
|
|
@@ -134,12 +156,12 @@ export const surveyTrail = trail('survey', {
|
|
|
134
156
|
kind: z.string(),
|
|
135
157
|
safety: z.string(),
|
|
136
158
|
})),
|
|
137
|
-
|
|
138
|
-
|
|
159
|
+
resourceCount: z.number(),
|
|
160
|
+
resources: z.array(z.object({
|
|
139
161
|
description: z.string().nullable(),
|
|
140
162
|
health: z.enum(['available', 'none']),
|
|
141
163
|
id: z.string(),
|
|
142
|
-
kind: z.literal('
|
|
164
|
+
kind: z.literal('resource'),
|
|
143
165
|
lifetime: z.literal('singleton'),
|
|
144
166
|
usedBy: z.array(z.string()),
|
|
145
167
|
})),
|
|
@@ -150,11 +172,11 @@ export const surveyTrail = trail('survey', {
|
|
|
150
172
|
detours: z.boolean(),
|
|
151
173
|
examples: z.boolean(),
|
|
152
174
|
outputSchemas: z.boolean(),
|
|
153
|
-
|
|
175
|
+
resources: z.boolean(),
|
|
154
176
|
signals: z.boolean(),
|
|
155
177
|
}),
|
|
156
178
|
name: z.string(),
|
|
157
|
-
|
|
179
|
+
resources: z.number(),
|
|
158
180
|
signals: z.number(),
|
|
159
181
|
trails: z.number(),
|
|
160
182
|
version: z.string(),
|
|
@@ -173,14 +195,14 @@ export const surveyTrail = trail('survey', {
|
|
|
173
195
|
id: z.string(),
|
|
174
196
|
intent: z.enum(['read', 'write', 'destroy']),
|
|
175
197
|
kind: z.string(),
|
|
176
|
-
|
|
198
|
+
resources: z.array(z.string()),
|
|
177
199
|
safety: z.string(),
|
|
178
200
|
}),
|
|
179
201
|
z.object({
|
|
180
202
|
description: z.string().nullable(),
|
|
181
203
|
health: z.enum(['available', 'none']),
|
|
182
204
|
id: z.string(),
|
|
183
|
-
kind: z.literal('
|
|
205
|
+
kind: z.literal('resource'),
|
|
184
206
|
lifetime: z.literal('singleton'),
|
|
185
207
|
usedBy: z.array(z.string()),
|
|
186
208
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"survey.js","sourceRoot":"","sources":["../../../src/trails/survey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"survey.js","sourceRoot":"","sources":["../../../src/trails/survey.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE9D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAO3B,8EAA8E;AAC9E,gCAAgC;AAChC,8EAA8E;AAE9E,MAAM,UAAU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,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;gBACnB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC3C,CAAC;YACF,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;gBACb,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;gBAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;gBACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;aACpB,CAAC;YACF,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;YAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9D,OAAO,EAAE,CAAC;iBACP,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;gBACP,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;gBAClC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;aAChB,CAAC,CACH;iBACA,QAAQ,EAAE;SACd,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export declare const topoExportTrail: import("@ontrails/core").Trail<{
|
|
2
|
-
module
|
|
2
|
+
module?: string | undefined;
|
|
3
3
|
rootDir?: string | undefined;
|
|
4
4
|
}, {
|
|
5
5
|
hash: string;
|
|
6
6
|
lockPath: string;
|
|
7
7
|
mapPath: string;
|
|
8
|
-
|
|
8
|
+
snapshot: {
|
|
9
9
|
createdAt: string;
|
|
10
10
|
gitDirty: boolean;
|
|
11
11
|
id: string;
|
|
12
|
-
|
|
12
|
+
resourceCount: number;
|
|
13
13
|
signalCount: number;
|
|
14
14
|
trailCount: number;
|
|
15
15
|
gitSha?: string | undefined;
|
|
16
|
+
pinnedAs?: string | undefined;
|
|
16
17
|
};
|
|
17
|
-
}>;
|
|
18
|
+
}, never>;
|
|
18
19
|
//# sourceMappingURL=topo-export.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-export.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-export.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"topo-export.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-export.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;SAwB1B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { trail } from '@ontrails/core';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { loadApp } from './load-app.js';
|
|
4
4
|
import { exportCurrentTopo } from './topo-store-support.js';
|
|
5
|
-
import {
|
|
5
|
+
import { createIsolatedExampleInput, topoSnapshotOutput, } from './topo-support.js';
|
|
6
6
|
export const topoExportTrail = trail('topo.export', {
|
|
7
7
|
blaze: async (input, ctx) => {
|
|
8
8
|
const rootDir = input.rootDir ?? ctx.cwd ?? process.cwd();
|
|
@@ -12,15 +12,12 @@ export const topoExportTrail = trail('topo.export', {
|
|
|
12
12
|
description: 'Export the current topo to .trails artifacts',
|
|
13
13
|
examples: [
|
|
14
14
|
{
|
|
15
|
-
input:
|
|
15
|
+
input: createIsolatedExampleInput('topo-export'),
|
|
16
16
|
name: 'Write the current topo export',
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
19
|
input: z.object({
|
|
20
|
-
module: z
|
|
21
|
-
.string()
|
|
22
|
-
.default(DEFAULT_APP_MODULE)
|
|
23
|
-
.describe('Path to the app module'),
|
|
20
|
+
module: z.string().optional().describe('Path to the app module'),
|
|
24
21
|
rootDir: z.string().optional().describe('Workspace root directory'),
|
|
25
22
|
}),
|
|
26
23
|
intent: 'write',
|
|
@@ -28,7 +25,7 @@ export const topoExportTrail = trail('topo.export', {
|
|
|
28
25
|
hash: z.string(),
|
|
29
26
|
lockPath: z.string(),
|
|
30
27
|
mapPath: z.string(),
|
|
31
|
-
|
|
28
|
+
snapshot: topoSnapshotOutput,
|
|
32
29
|
}),
|
|
33
30
|
});
|
|
34
31
|
//# sourceMappingURL=topo-export.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-export.js","sourceRoot":"","sources":["../../../src/trails/topo-export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"topo-export.js","sourceRoot":"","sources":["../../../src/trails/topo-export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,EAAE;IAClD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,iBAAiB,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,0BAA0B,CAAC,aAAa,CAAC;YAChD,IAAI,EAAE,+BAA+B;SACtC;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAChE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -4,21 +4,17 @@ export declare const topoHistoryTrail: import("@ontrails/core").Trail<{
|
|
|
4
4
|
}, {
|
|
5
5
|
dbPath: string;
|
|
6
6
|
limit: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
name: string;
|
|
11
|
-
saveId: string;
|
|
12
|
-
}[];
|
|
13
|
-
saveCount: number;
|
|
14
|
-
saves: {
|
|
7
|
+
pinnedCount: number;
|
|
8
|
+
snapshotCount: number;
|
|
9
|
+
snapshots: {
|
|
15
10
|
createdAt: string;
|
|
16
11
|
gitDirty: boolean;
|
|
17
12
|
id: string;
|
|
18
|
-
|
|
13
|
+
resourceCount: number;
|
|
19
14
|
signalCount: number;
|
|
20
15
|
trailCount: number;
|
|
21
16
|
gitSha?: string | undefined;
|
|
17
|
+
pinnedAs?: string | undefined;
|
|
22
18
|
}[];
|
|
23
|
-
}>;
|
|
19
|
+
}, never>;
|
|
24
20
|
//# sourceMappingURL=topo-history.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-history.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"topo-history.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-history.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;SA2B3B,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Result, trail } from '@ontrails/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { DEFAULT_TOPO_HISTORY_LIMIT,
|
|
3
|
+
import { DEFAULT_TOPO_HISTORY_LIMIT, createIsolatedExampleInput, listTopoHistory, topoSnapshotOutput, } from './topo-support.js';
|
|
4
4
|
export const topoHistoryTrail = trail('topo.history', {
|
|
5
5
|
blaze: (input, ctx) => {
|
|
6
6
|
const rootDir = input.rootDir ?? ctx.cwd ?? process.cwd();
|
|
7
7
|
return Result.ok(listTopoHistory({ limit: input.limit, rootDir }));
|
|
8
8
|
},
|
|
9
|
-
description: 'List saved topo
|
|
9
|
+
description: 'List saved topo snapshots, including pinned references',
|
|
10
10
|
examples: [
|
|
11
11
|
{
|
|
12
|
-
input:
|
|
12
|
+
input: createIsolatedExampleInput('topo-history'),
|
|
13
13
|
name: 'Show topo history',
|
|
14
14
|
},
|
|
15
15
|
],
|
|
@@ -17,17 +17,16 @@ export const topoHistoryTrail = trail('topo.history', {
|
|
|
17
17
|
limit: z
|
|
18
18
|
.number()
|
|
19
19
|
.default(DEFAULT_TOPO_HISTORY_LIMIT)
|
|
20
|
-
.describe('Maximum number of
|
|
20
|
+
.describe('Maximum number of snapshots to return'),
|
|
21
21
|
rootDir: z.string().optional().describe('Workspace root directory'),
|
|
22
22
|
}),
|
|
23
23
|
intent: 'read',
|
|
24
24
|
output: z.object({
|
|
25
25
|
dbPath: z.string(),
|
|
26
26
|
limit: z.number(),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
saves: z.array(topoSaveOutput),
|
|
27
|
+
pinnedCount: z.number(),
|
|
28
|
+
snapshotCount: z.number(),
|
|
29
|
+
snapshots: z.array(topoSnapshotOutput),
|
|
31
30
|
}),
|
|
32
31
|
});
|
|
33
32
|
//# sourceMappingURL=topo-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-history.js","sourceRoot":"","sources":["../../../src/trails/topo-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"topo-history.js","sourceRoot":"","sources":["../../../src/trails/topo-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,cAAc,EAAE;IACpD,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACpB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1D,OAAO,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,WAAW,EAAE,wDAAwD;IACrE,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,0BAA0B,CAAC,cAAc,CAAC;YACjD,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,OAAO,CAAC,0BAA0B,CAAC;aACnC,QAAQ,CAAC,uCAAuC,CAAC;QACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;KACvC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
export declare const topoPinTrail: import("@ontrails/core").Trail<{
|
|
2
|
-
module: string;
|
|
3
2
|
name: string;
|
|
3
|
+
module?: string | undefined;
|
|
4
4
|
rootDir?: string | undefined;
|
|
5
5
|
}, {
|
|
6
|
-
|
|
7
|
-
createdAt: string;
|
|
8
|
-
name: string;
|
|
9
|
-
saveId: string;
|
|
10
|
-
};
|
|
11
|
-
save: {
|
|
6
|
+
snapshot: {
|
|
12
7
|
createdAt: string;
|
|
13
8
|
gitDirty: boolean;
|
|
14
9
|
id: string;
|
|
15
|
-
|
|
10
|
+
resourceCount: number;
|
|
16
11
|
signalCount: number;
|
|
17
12
|
trailCount: number;
|
|
18
13
|
gitSha?: string | undefined;
|
|
14
|
+
pinnedAs?: string | undefined;
|
|
19
15
|
};
|
|
20
|
-
}>;
|
|
16
|
+
}, never>;
|
|
21
17
|
//# sourceMappingURL=topo-pin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-pin.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-pin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"topo-pin.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-pin.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;SA2BvB,CAAC"}
|
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import { Result, trail } from '@ontrails/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { loadApp } from './load-app.js';
|
|
4
|
-
import {
|
|
4
|
+
import { createIsolatedExampleInput, pinCurrentTopoSnapshot, topoSnapshotOutput, } from './topo-support.js';
|
|
5
5
|
export const topoPinTrail = trail('topo.pin', {
|
|
6
6
|
blaze: async (input, ctx) => {
|
|
7
7
|
const rootDir = input.rootDir ?? ctx.cwd ?? process.cwd();
|
|
8
8
|
const app = await loadApp(input.module, rootDir);
|
|
9
|
-
return Result.ok(
|
|
9
|
+
return Result.ok(pinCurrentTopoSnapshot(app, { name: input.name, rootDir }));
|
|
10
10
|
},
|
|
11
11
|
description: 'Pin the current topo under a durable name',
|
|
12
12
|
examples: [
|
|
13
13
|
{
|
|
14
14
|
input: {
|
|
15
|
-
...
|
|
15
|
+
...createIsolatedExampleInput('topo-pin'),
|
|
16
16
|
name: 'before-auth-refactor',
|
|
17
17
|
},
|
|
18
18
|
name: 'Pin the current topo',
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
21
|
input: z.object({
|
|
22
|
-
module: z
|
|
23
|
-
.string()
|
|
24
|
-
.default(DEFAULT_APP_MODULE)
|
|
25
|
-
.describe('Path to the app module'),
|
|
22
|
+
module: z.string().optional().describe('Path to the app module'),
|
|
26
23
|
name: z.string().describe('Pin name'),
|
|
27
24
|
rootDir: z.string().optional().describe('Workspace root directory'),
|
|
28
25
|
}),
|
|
29
26
|
intent: 'write',
|
|
30
27
|
output: z.object({
|
|
31
|
-
|
|
32
|
-
save: topoSaveOutput,
|
|
28
|
+
snapshot: topoSnapshotOutput,
|
|
33
29
|
}),
|
|
34
30
|
});
|
|
35
31
|
//# sourceMappingURL=topo-pin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-pin.js","sourceRoot":"","sources":["../../../src/trails/topo-pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"topo-pin.js","sourceRoot":"","sources":["../../../src/trails/topo-pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,EAAE;IAC5C,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC1B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,MAAM,CAAC,EAAE,CACd,sBAAsB,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAC3D,CAAC;IACJ,CAAC;IACD,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE;QACR;YACE,KAAK,EAAE;gBACL,GAAG,0BAA0B,CAAC,UAAU,CAAC;gBACzC,IAAI,EAAE,sBAAsB;aAC7B;YACD,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QAChE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;QACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Read-only topo store consumer helpers.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from topo-support.ts
|
|
5
|
-
* keeping
|
|
4
|
+
* Extracted from topo-support.ts to isolate read-only store consumer helpers,
|
|
5
|
+
* keeping module boundaries clean.
|
|
6
6
|
*/
|
|
7
|
-
import type { Topo } from '@ontrails/core';
|
|
8
7
|
import { Result } from '@ontrails/core';
|
|
8
|
+
import type { Topo } from '@ontrails/core';
|
|
9
9
|
import type { BriefReport, SurveyListReport } from './topo-reports.js';
|
|
10
10
|
import type { TopoSummaryReport, TopoVerifyReport } from './topo-support.js';
|
|
11
11
|
interface CurrentTrailDetail {
|
|
12
12
|
readonly crosses: string[];
|
|
13
13
|
readonly description: string | null;
|
|
14
|
-
readonly detours:
|
|
14
|
+
readonly detours: readonly {
|
|
15
|
+
readonly on: string;
|
|
16
|
+
readonly maxAttempts: number;
|
|
17
|
+
}[] | null;
|
|
15
18
|
readonly examples: unknown[];
|
|
16
19
|
readonly id: string;
|
|
17
20
|
readonly intent: 'destroy' | 'read' | 'write';
|
|
18
21
|
readonly kind: string;
|
|
19
|
-
readonly
|
|
22
|
+
readonly pattern: string | null;
|
|
23
|
+
readonly resources: string[];
|
|
20
24
|
readonly safety: string;
|
|
21
25
|
}
|
|
22
|
-
interface
|
|
26
|
+
interface CurrentResourceDetail {
|
|
23
27
|
readonly description: string | null;
|
|
24
28
|
readonly health: 'available' | 'none';
|
|
25
29
|
readonly id: string;
|
|
26
|
-
readonly kind: '
|
|
30
|
+
readonly kind: 'resource';
|
|
27
31
|
readonly lifetime: 'singleton';
|
|
28
32
|
readonly usedBy: string[];
|
|
29
33
|
}
|
|
@@ -46,7 +50,7 @@ export declare const buildCurrentGuideEntries: (app: Topo, options?: {
|
|
|
46
50
|
}[];
|
|
47
51
|
export declare const buildCurrentTopoDetail: (app: Topo, id: string, options?: {
|
|
48
52
|
readonly rootDir?: string;
|
|
49
|
-
}) =>
|
|
53
|
+
}) => CurrentResourceDetail | CurrentTrailDetail | undefined;
|
|
50
54
|
export declare const verifyCurrentTopo: (app: Topo, options?: {
|
|
51
55
|
readonly rootDir?: string;
|
|
52
56
|
}) => Promise<Result<TopoVerifyReport, Error>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topo-read-support.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-read-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"topo-read-support.d.ts","sourceRoot":"","sources":["../../../src/trails/topo-read-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAML,MAAM,EACP,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,gBAAgB,CAAC;AAOzD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBA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