@quolu/lattice 0.101.0 → 0.101.1
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/package.json +1 -1
- package/src/chart-cli.mjs +16 -7
- package/src/cli-help.mjs +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.101.
|
|
3
|
+
"version": "0.101.1",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|
package/src/chart-cli.mjs
CHANGED
|
@@ -175,24 +175,33 @@ function projectIdOf(env, dir) {
|
|
|
175
175
|
return env[PROJECT_ID_ENV] || path.basename(dir);
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
/**
|
|
178
|
+
/**
|
|
179
|
+
* K4 `chart set [--name <text>] [--created-by <id>]`, at least one; `created` = K5 made the chart in this run.
|
|
180
|
+
* Without --name the patch has no `name` key, so the name stays as is (null stays null): the a102 sidecar migration.
|
|
181
|
+
*/
|
|
179
182
|
async function chartSet({ cwd, env, flags, created }) {
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
if (!('name' in flags) && !('created-by' in flags)) {
|
|
184
|
+
throw refusal('CHART_NAME_INVALID', 'chart_set_flag_missing', { field: '--name',
|
|
185
|
+
rule: '--name, --created-by or both',
|
|
186
|
+
next_action: 'lattice chart set --name <text> [--created-by <id>] (or --created-by <id> alone)' });
|
|
187
|
+
}
|
|
188
|
+
const name = 'name' in flags ? (typeof flags.name === 'string' ? flags.name.trim() : null) : undefined;
|
|
189
|
+
if (name !== undefined && !validChartName(name)) {
|
|
182
190
|
throw refusal('CHART_NAME_INVALID', 'chart_name_invalid', { field: '--name',
|
|
183
191
|
rule: '1-40 characters after trimming, no control characters',
|
|
184
192
|
next_action: 'lattice chart set --name <text>' });
|
|
185
193
|
}
|
|
186
|
-
const explicit = typeof flags['created-by'] === 'string' ? flags['created-by'].trim() :
|
|
194
|
+
const explicit = 'created-by' in flags ? (typeof flags['created-by'] === 'string' ? flags['created-by'].trim() : null)
|
|
195
|
+
: undefined;
|
|
187
196
|
if (explicit !== undefined && !validChartName(explicit)) {
|
|
188
197
|
throw refusal('CHART_NAME_INVALID', 'chart_created_by_invalid', { field: '--created-by',
|
|
189
198
|
rule: '1-40 characters after trimming, no control characters',
|
|
190
|
-
next_action: 'lattice chart set --
|
|
199
|
+
next_action: 'lattice chart set --created-by <id>' });
|
|
191
200
|
}
|
|
192
201
|
const dir = await repoRoot(cwd);
|
|
193
202
|
const createdBy = explicit ?? (created ? env[SEAT_ID_ENV] || null : undefined);
|
|
194
203
|
const { meta, unchanged } = await writeTodoChartMeta({ repoRoot: dir,
|
|
195
|
-
patch: { name, ...(createdBy === undefined ? {} : { created_by: createdBy }) } });
|
|
204
|
+
patch: { ...(name === undefined ? {} : { name }), ...(createdBy === undefined ? {} : { created_by: createdBy }) } });
|
|
196
205
|
return { schema: 'lattice.chart_set_result.v1', project_id: projectIdOf(env, dir), name: meta.name,
|
|
197
206
|
created_by: meta.created_by, created_at: meta.created_at, unchanged };
|
|
198
207
|
}
|
|
@@ -317,7 +326,7 @@ export async function runChartCli({ argv, cwd, env, stdout, stderr, created = fa
|
|
|
317
326
|
} else if (group === 'chart' && command === 'set') {
|
|
318
327
|
const { flags, rest } = parseFlagMap(words.slice(2));
|
|
319
328
|
if (rest.length > 0 || Object.keys(flags).some((key) => !['name', 'created-by'].includes(key))) {
|
|
320
|
-
return usage(stderr, 'chart set --name <text> [--created-by <id>] [--json]');
|
|
329
|
+
return usage(stderr, 'chart set [--name <text>] [--created-by <id>] [--json]');
|
|
321
330
|
}
|
|
322
331
|
result = await chartSet({ cwd, env, flags, created });
|
|
323
332
|
} else if (group === 'chart' && command === 'repo' && sub === 'bind') {
|
package/src/cli-help.mjs
CHANGED
|
@@ -321,8 +321,8 @@ const SUBCOMMAND_USAGE = Object.freeze({
|
|
|
321
321
|
charts: 'charts list [--json] | source [--project <id>]... [--json] # LATTICE_CHARTS_ROOT配下の全工程表を1プロセスで読む',
|
|
322
322
|
'charts list': 'charts list [--json] # lattice.charts_list_result.v1 {charts_root, charts:[{project_id, name, created_by, created_at, source}], findings}',
|
|
323
323
|
'charts source': 'charts source [--project <id>]... [--json] # lattice.charts_source_result.v1 {charts:{<id>: <source>|null}}(--project無し=全工程表)',
|
|
324
|
-
chart: 'chart set --name <text> [--created-by <id>] [--json] | repo bind --url <url> --branch <branch> [--json] | repo sync [--json]',
|
|
325
|
-
'chart set': 'chart set --name <text> [--created-by <id>] [--json] # lattice.chart_set_result.v1
|
|
324
|
+
chart: 'chart set [--name <text>] [--created-by <id>] [--json] | repo bind --url <url> --branch <branch> [--json] | repo sync [--json]',
|
|
325
|
+
'chart set': 'chart set [--name <text>] [--created-by <id>] [--json] # lattice.chart_set_result.v1(どちらか1つ以上。名前は1-40字・制御文字なし。--nameが無ければ名前はそのまま。--created-byは作成者が空の時だけ)',
|
|
326
326
|
'chart repo': 'chart repo bind --url <url> --branch <branch> [--json] | sync [--json] # lattice.chart_repo_result.v1',
|
|
327
327
|
'chart repo bind': 'chart repo bind --url <url> --branch <branch> [--json] # コード工程表のrepoを記録する',
|
|
328
328
|
'chart repo sync': 'chart repo sync [--json] # depth-1 fetch、accepted_tipからだけ前進(reset/forceしない)、その後sensor。status current|synced|dirty|diverged|failed',
|