@remits/remits-cli 0.1.132 → 0.1.133
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/index.js +290 -28
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
- L22 Runtime Bootstrap And Shared State
|
|
7
7
|
- L119 Sessions, Account Resolution, And Production Guards
|
|
8
8
|
- L603 Local State, Workspaces, And Verification Evidence
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
9
|
+
- L2255 Account Repos, Guide Sync, And Platform Repo
|
|
10
|
+
- L2949 Component Discovery And HTTP Logging
|
|
11
|
+
- L3525 Skill Delivery And TOC Resolution
|
|
12
|
+
- L3835 Auth And Component Staging
|
|
13
|
+
- L4449 Component Summaries, Status, And Sync Gates
|
|
14
|
+
- L6518 Branches, Promotion, Commit, And Test Runs
|
|
15
|
+
- L8183 Tokens, Tools, Verification, And Config
|
|
16
|
+
- L9405 Service Dashboard And WebSocket Listener
|
|
17
|
+
- L11521 Agent And Ticket Workflows
|
|
18
|
+
- L14815 Help, Auto Update, And Command Dispatch
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/*
|
|
@@ -1934,6 +1934,106 @@ function printVerificationEnvelope(envelope, fallbackEnvelopeId) {
|
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
1936
1936
|
|
|
1937
|
+
function slimVerificationPacket(packet) {
|
|
1938
|
+
const p = packet || {};
|
|
1939
|
+
const world = p.world || {};
|
|
1940
|
+
return {
|
|
1941
|
+
packetId: p.packetId || p.id || null,
|
|
1942
|
+
type: p.type || 'unknown',
|
|
1943
|
+
success: p.success !== false,
|
|
1944
|
+
stale: Boolean(p.stale),
|
|
1945
|
+
claim: p.claim || p.summary || null,
|
|
1946
|
+
taskId: p.taskId || (p.testRun && p.testRun.taskId) || null,
|
|
1947
|
+
testName: p.testName || (p.testRun && p.testRun.testName) || null,
|
|
1948
|
+
accountId: world.accountId || p.accountId || null,
|
|
1949
|
+
dataMode: world.dataMode || p.dataMode || null,
|
|
1950
|
+
branchName: world.branchName || p.branchName || null,
|
|
1951
|
+
workspace: world.workspace || p.workspace || null,
|
|
1952
|
+
recordedAt: formatTime(p.recordedAt || p.createdAt || p.at || p.timestamp),
|
|
1953
|
+
message: p.message || p.error || null
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
function compactVerificationEnvelope(envelope, fallbackEnvelopeId) {
|
|
1958
|
+
const env = envelope || {};
|
|
1959
|
+
const evaluation = env.evaluation || {};
|
|
1960
|
+
const packets = Array.isArray(env.packets) ? env.packets : [];
|
|
1961
|
+
const failures = Array.isArray(evaluation.currentFailures)
|
|
1962
|
+
? evaluation.currentFailures
|
|
1963
|
+
: packets.filter((packet) => packet && packet.success === false && !packet.stale);
|
|
1964
|
+
const stale = Array.isArray(evaluation.stale) ? evaluation.stale : packets.filter((packet) => packet && packet.stale);
|
|
1965
|
+
const requiredEvidence = ((env.acceptance || {}).requiredEvidence || evaluation.requiredEvidence || []);
|
|
1966
|
+
const latestByType = evaluation.latestByType || env.latestByType || {};
|
|
1967
|
+
const nextActions = [];
|
|
1968
|
+
|
|
1969
|
+
if (evaluation.noRequiredEvidence) {
|
|
1970
|
+
nextActions.push('Attach a manifest or required evidence contract; packets are context, not proof of completion.');
|
|
1971
|
+
}
|
|
1972
|
+
if (failures.length) {
|
|
1973
|
+
nextActions.push('Inspect and replace the current failing evidence packet(s).');
|
|
1974
|
+
}
|
|
1975
|
+
if (stale.length) {
|
|
1976
|
+
nextActions.push('Re-run stale evidence after the requirement/source change.');
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
return {
|
|
1980
|
+
envelopeId: env.envelopeId || fallbackEnvelopeId || null,
|
|
1981
|
+
summary: env.summary || null,
|
|
1982
|
+
status: env.status || 'unknown',
|
|
1983
|
+
health: evaluation.health || null,
|
|
1984
|
+
acceptanceStatus: evaluation.acceptanceStatus || env.acceptanceStatus || null,
|
|
1985
|
+
requiredEvidence: {
|
|
1986
|
+
satisfiedCount: evaluation.satisfiedCount || 0,
|
|
1987
|
+
requiredCount: evaluation.requiredCount || requiredEvidence.length || 0,
|
|
1988
|
+
missingCount: evaluation.missingCount || 0,
|
|
1989
|
+
staleCount: evaluation.staleCount || stale.length || 0,
|
|
1990
|
+
noRequiredEvidence: Boolean(evaluation.noRequiredEvidence),
|
|
1991
|
+
declared: requiredEvidence.slice(0, 10).map((entry) => ({
|
|
1992
|
+
type: entry && entry.type || entry && entry.evidenceType || null,
|
|
1993
|
+
category: entry && entry.category || null,
|
|
1994
|
+
claim: entry && entry.claim || entry && entry.description || null
|
|
1995
|
+
}))
|
|
1996
|
+
},
|
|
1997
|
+
packets: {
|
|
1998
|
+
count: packets.length,
|
|
1999
|
+
failedCount: evaluation.failedCount || failures.length || 0,
|
|
2000
|
+
currentFailureCount: evaluation.currentFailureCount || failures.length || 0,
|
|
2001
|
+
lastPacketAt: formatTime(env.lastPacketAtMs || env.latestPacketAtMs || env.updatedAtMs),
|
|
2002
|
+
recent: packets.slice(-5).map(slimVerificationPacket)
|
|
2003
|
+
},
|
|
2004
|
+
latestByType,
|
|
2005
|
+
currentFailures: failures.slice(0, 10).map(slimVerificationPacket),
|
|
2006
|
+
stale: stale.slice(0, 10).map(slimVerificationPacket),
|
|
2007
|
+
warnings: (env.warnings || []).slice(0, 10),
|
|
2008
|
+
nextActions
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
function printCompactVerificationEnvelope(compact) {
|
|
2013
|
+
console.log('Verification envelope:', compact.envelopeId || '(no id)');
|
|
2014
|
+
if (compact.summary) console.log('Summary:', compact.summary);
|
|
2015
|
+
console.log('Status:', compact.status + (compact.health ? ' health=' + compact.health : ''));
|
|
2016
|
+
if (compact.requiredEvidence.noRequiredEvidence) {
|
|
2017
|
+
console.log('Required evidence: none declared');
|
|
2018
|
+
} else {
|
|
2019
|
+
console.log('Required evidence:', compact.requiredEvidence.satisfiedCount + '/' + compact.requiredEvidence.requiredCount +
|
|
2020
|
+
(compact.requiredEvidence.staleCount ? ' stale=' + compact.requiredEvidence.staleCount : ''));
|
|
2021
|
+
}
|
|
2022
|
+
console.log('Packets:', compact.packets.count + ' current failures=' + compact.packets.currentFailureCount);
|
|
2023
|
+
if (compact.currentFailures.length) {
|
|
2024
|
+
console.log('Current failures:');
|
|
2025
|
+
compact.currentFailures.forEach((packet) => {
|
|
2026
|
+
console.log(' - ' + packet.type + ' ' + (packet.packetId || '') + (packet.claim ? ' - ' + packet.claim : '') +
|
|
2027
|
+
(packet.message ? ' (' + packet.message + ')' : ''));
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
if (compact.nextActions.length) {
|
|
2031
|
+
console.log('Next actions:');
|
|
2032
|
+
compact.nextActions.forEach((action) => console.log(' - ' + action));
|
|
2033
|
+
}
|
|
2034
|
+
console.log('Full envelope: remits-cli verify show --json');
|
|
2035
|
+
}
|
|
2036
|
+
|
|
1937
2037
|
function printAcceptanceWarnings(envelope) {
|
|
1938
2038
|
const warnings = envelope && envelope.acceptance && Array.isArray(envelope.acceptance.warnings)
|
|
1939
2039
|
? envelope.acceptance.warnings
|
|
@@ -2809,6 +2909,42 @@ function resolveSessionContext(cwd, flags) {
|
|
|
2809
2909
|
};
|
|
2810
2910
|
}
|
|
2811
2911
|
|
|
2912
|
+
function hasExplicitAccountIdFlag(flags) {
|
|
2913
|
+
const value = Number(flags && flags['account-id']);
|
|
2914
|
+
return Number.isFinite(value) && value > 0;
|
|
2915
|
+
}
|
|
2916
|
+
|
|
2917
|
+
function platformRepoEntryMatchesCwd(cwd) {
|
|
2918
|
+
const entry = getPlatformRepoEntry();
|
|
2919
|
+
if (!entry || !entry.directory || !cwd) return false;
|
|
2920
|
+
try {
|
|
2921
|
+
return path.resolve(entry.directory) === path.resolve(cwd);
|
|
2922
|
+
} catch (_) {
|
|
2923
|
+
return false;
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
function platformRepoAccountCommandProblem(cwd, flags, commandName, sessionContext) {
|
|
2928
|
+
if (hasExplicitAccountIdFlag(flags)) return null;
|
|
2929
|
+
try {
|
|
2930
|
+
if (loadAccountInfo(cwd)) return null;
|
|
2931
|
+
} catch (_) {
|
|
2932
|
+
// No account-info.json means the command would fall back to session state.
|
|
2933
|
+
}
|
|
2934
|
+
if (!looksLikePlatformRepo(cwd) && !platformRepoEntryMatchesCwd(cwd)) return null;
|
|
2935
|
+
|
|
2936
|
+
const account = sessionContext && sessionContext.accountId
|
|
2937
|
+
? 'account ' + sessionContext.accountId
|
|
2938
|
+
: 'the last authenticated account';
|
|
2939
|
+
return 'Refusing ' + commandName + ' from the Remits platform repo. This checkout is back-stage platform source, not an account repository, so the command would target ' +
|
|
2940
|
+
account + ' from session state. Run it from that account repo, or pass --account-id <id> explicitly if you really intend to inspect that account from here.';
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
function requireAccountRepoContext(cwd, flags, commandName, sessionContext) {
|
|
2944
|
+
const problem = platformRepoAccountCommandProblem(cwd, flags, commandName, sessionContext);
|
|
2945
|
+
if (problem) throw new Error(problem);
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2812
2948
|
/*
|
|
2813
2949
|
## Component Discovery And HTTP Logging
|
|
2814
2950
|
*/
|
|
@@ -3892,6 +4028,7 @@ async function pushComponentsCommand(flags) {
|
|
|
3892
4028
|
const cwd = process.cwd();
|
|
3893
4029
|
ensureLocalState(cwd);
|
|
3894
4030
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
4031
|
+
requireAccountRepoContext(cwd, flags, 'components stage', sessionContext);
|
|
3895
4032
|
const { session, accountId } = sessionContext;
|
|
3896
4033
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
3897
4034
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -4823,7 +4960,8 @@ function printBranchContext(response) {
|
|
|
4823
4960
|
console.log(' commit writes: ' + ctx.commitWrites);
|
|
4824
4961
|
if (Object.prototype.hasOwnProperty.call(ctx, 'lastSyncedSha')) {
|
|
4825
4962
|
// null is "unknown" (never synced, expired, or the last sync had errors) — never "nothing landed".
|
|
4826
|
-
|
|
4963
|
+
const source = ctx.lastSyncedShaSource ? ' [' + ctx.lastSyncedShaSource + ']' : '';
|
|
4964
|
+
console.log(' last platform sync of this branch: ' + (ctx.lastSyncedSha ? short(ctx.lastSyncedSha) : 'unknown') + source);
|
|
4827
4965
|
}
|
|
4828
4966
|
if (ctx.repository) {
|
|
4829
4967
|
console.log(' sync reads repository: ' + ctx.repository +
|
|
@@ -5014,6 +5152,7 @@ async function statusComponentsCommand(flags) {
|
|
|
5014
5152
|
const cwd = process.cwd();
|
|
5015
5153
|
ensureLocalState(cwd);
|
|
5016
5154
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
5155
|
+
requireAccountRepoContext(cwd, flags, 'components status', sessionContext);
|
|
5017
5156
|
const { session, accountId } = sessionContext;
|
|
5018
5157
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
5019
5158
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -5082,6 +5221,7 @@ async function lanesComponentsCommand(flags) {
|
|
|
5082
5221
|
const cwd = process.cwd();
|
|
5083
5222
|
ensureLocalState(cwd);
|
|
5084
5223
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
5224
|
+
requireAccountRepoContext(cwd, flags, 'components lanes', sessionContext);
|
|
5085
5225
|
const { session, accountId } = sessionContext;
|
|
5086
5226
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
5087
5227
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -5173,6 +5313,7 @@ async function entriesComponentsCommand(flags) {
|
|
|
5173
5313
|
const cwd = process.cwd();
|
|
5174
5314
|
ensureLocalState(cwd);
|
|
5175
5315
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
5316
|
+
requireAccountRepoContext(cwd, flags, 'components entries', sessionContext);
|
|
5176
5317
|
const { session, accountId } = sessionContext;
|
|
5177
5318
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
5178
5319
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -5216,6 +5357,7 @@ async function clearComponentsCommand(flags) {
|
|
|
5216
5357
|
const cwd = process.cwd();
|
|
5217
5358
|
ensureLocalState(cwd);
|
|
5218
5359
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
5360
|
+
requireAccountRepoContext(cwd, flags, 'components clear', sessionContext);
|
|
5219
5361
|
const { session, accountId } = sessionContext;
|
|
5220
5362
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
5221
5363
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -5275,6 +5417,7 @@ async function syncComponentsCommand(rawFlags) {
|
|
|
5275
5417
|
const flags = safe ? expandSafeSyncFlags(rawFlags) : rawFlags;
|
|
5276
5418
|
ensureLocalState(cwd);
|
|
5277
5419
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
5420
|
+
requireAccountRepoContext(cwd, flags, 'components sync', sessionContext);
|
|
5278
5421
|
const { session, accountId } = sessionContext;
|
|
5279
5422
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
5280
5423
|
const branchName = flags.branch || currentBranch(cwd);
|
|
@@ -6382,6 +6525,7 @@ async function branchesComponentsCommand(flags) {
|
|
|
6382
6525
|
const cwd = process.cwd();
|
|
6383
6526
|
ensureLocalState(cwd);
|
|
6384
6527
|
const sessionContext = resolveSessionContext(cwd, flags);
|
|
6528
|
+
requireAccountRepoContext(cwd, flags, 'components branches', sessionContext);
|
|
6385
6529
|
const { session, accountId } = sessionContext;
|
|
6386
6530
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
6387
6531
|
const api = buildAxios(baseUrl, session.token);
|
|
@@ -6579,6 +6723,7 @@ async function promotionComponentsCommand(flags) {
|
|
|
6579
6723
|
const cwd = process.cwd();
|
|
6580
6724
|
ensureLocalState(cwd);
|
|
6581
6725
|
const sessionContext = resolvePromotionSessionContext(cwd, flags);
|
|
6726
|
+
requireAccountRepoContext(cwd, flags, 'components promotion', sessionContext);
|
|
6582
6727
|
const { session, accountId } = sessionContext;
|
|
6583
6728
|
const baseUrl = flags['base-url'] || session.baseUrl || DEFAULT_BASE_URL;
|
|
6584
6729
|
const api = buildAxios(baseUrl, session.token);
|
|
@@ -6744,7 +6889,9 @@ function shortSignature(signature) {
|
|
|
6744
6889
|
async function commitComponentsCommand(flags) {
|
|
6745
6890
|
const cwd = process.cwd();
|
|
6746
6891
|
ensureLocalState(cwd);
|
|
6747
|
-
const
|
|
6892
|
+
const sessionContext = resolveSessionContext(cwd, flags);
|
|
6893
|
+
requireAccountRepoContext(cwd, flags, 'components commit', sessionContext);
|
|
6894
|
+
const { session, accountId } = sessionContext;
|
|
6748
6895
|
const branchName = flags.branch || currentBranch(cwd);
|
|
6749
6896
|
const commitMessage = String(flags.message || ('remits-cli commit sync ' + new Date().toISOString()));
|
|
6750
6897
|
const allowEmpty = flags['allow-empty'] === true || flags['allow-empty'] === 'true';
|
|
@@ -8945,11 +9092,18 @@ async function verifyCommand(flags, subcommand) {
|
|
|
8945
9092
|
if (sub === 'show' || sub === 'read' || sub === 'get' || sub === 'packets') {
|
|
8946
9093
|
const response = await postVerificationCommand(api, cwd, session, accountId, 'show', { envelopeId });
|
|
8947
9094
|
if (response.envelope) writeLocalVerificationEnvelope(cwd, response.envelope);
|
|
9095
|
+
const envelope = response.envelope || {};
|
|
9096
|
+
const compact = flagEnabled(flags.summary) || flagEnabled(flags.compact);
|
|
8948
9097
|
if (flagEnabled(flags.json)) {
|
|
8949
|
-
|
|
8950
|
-
|
|
9098
|
+
const payload = compact ? compactVerificationEnvelope(envelope, envelopeId) : (response.envelope || response);
|
|
9099
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
9100
|
+
return payload;
|
|
9101
|
+
}
|
|
9102
|
+
if (compact) {
|
|
9103
|
+
const payload = compactVerificationEnvelope(envelope, envelopeId);
|
|
9104
|
+
printCompactVerificationEnvelope(payload);
|
|
9105
|
+
return payload;
|
|
8951
9106
|
}
|
|
8952
|
-
const envelope = response.envelope || {};
|
|
8953
9107
|
printVerificationEnvelope(envelope, envelopeId);
|
|
8954
9108
|
return envelope;
|
|
8955
9109
|
}
|
|
@@ -13870,8 +14024,11 @@ async function activityInspectCommand(flags) {
|
|
|
13870
14024
|
|
|
13871
14025
|
if (!response.success) throw new Error(response.message || 'Activity inspection failed');
|
|
13872
14026
|
if (flagEnabled(flags.json)) {
|
|
13873
|
-
|
|
13874
|
-
|
|
14027
|
+
const payload = (flagEnabled(flags.summary) || flagEnabled(flags.compact))
|
|
14028
|
+
? compactActivityInspect(response)
|
|
14029
|
+
: response;
|
|
14030
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
14031
|
+
return payload;
|
|
13875
14032
|
}
|
|
13876
14033
|
|
|
13877
14034
|
printSessionResolutionWarning(sessionContext);
|
|
@@ -13880,6 +14037,98 @@ async function activityInspectCommand(flags) {
|
|
|
13880
14037
|
return response;
|
|
13881
14038
|
}
|
|
13882
14039
|
|
|
14040
|
+
function smellSeverityRank(smell) {
|
|
14041
|
+
const severity = String((smell && smell.severity) || 'info').toLowerCase();
|
|
14042
|
+
if (severity === 'critical') return 0;
|
|
14043
|
+
if (severity === 'high') return 1;
|
|
14044
|
+
if (severity === 'medium') return 2;
|
|
14045
|
+
if (severity === 'low') return 3;
|
|
14046
|
+
return 4;
|
|
14047
|
+
}
|
|
14048
|
+
|
|
14049
|
+
function sortedActivitySmells(smells) {
|
|
14050
|
+
return (Array.isArray(smells) ? smells.slice() : []).sort((left, right) => {
|
|
14051
|
+
const severity = smellSeverityRank(left) - smellSeverityRank(right);
|
|
14052
|
+
if (severity) return severity;
|
|
14053
|
+
return String(right.updatedAt || right.at || '').localeCompare(String(left.updatedAt || left.at || ''));
|
|
14054
|
+
});
|
|
14055
|
+
}
|
|
14056
|
+
|
|
14057
|
+
function slimActivitySmell(smell) {
|
|
14058
|
+
const s = smell || {};
|
|
14059
|
+
return {
|
|
14060
|
+
severity: s.severity || 'info',
|
|
14061
|
+
type: s.type || 'signal',
|
|
14062
|
+
summary: s.summary || null,
|
|
14063
|
+
accountId: s.accountId || null,
|
|
14064
|
+
laneId: s.laneId || null,
|
|
14065
|
+
envelopeId: s.envelopeId || null,
|
|
14066
|
+
taskId: s.taskId || null,
|
|
14067
|
+
branchName: s.branchName || null,
|
|
14068
|
+
workspace: s.workspace || null
|
|
14069
|
+
};
|
|
14070
|
+
}
|
|
14071
|
+
|
|
14072
|
+
function compactActivityInspect(response) {
|
|
14073
|
+
const counts = response.counts || {};
|
|
14074
|
+
const smells = sortedActivitySmells(response.smells);
|
|
14075
|
+
const lanes = Array.isArray(response.lanes) ? response.lanes : [];
|
|
14076
|
+
const envelopes = Array.isArray(response.envelopes) ? response.envelopes : [];
|
|
14077
|
+
const testRuns = Array.isArray(response.testRuns) ? response.testRuns : [];
|
|
14078
|
+
const nextActions = smells
|
|
14079
|
+
.filter((smell) => smellSeverityRank(smell) <= 2)
|
|
14080
|
+
.slice(0, 5)
|
|
14081
|
+
.map((smell) => (smell.type || 'signal') + ': ' + (smell.summary || 'inspect this signal'));
|
|
14082
|
+
|
|
14083
|
+
return {
|
|
14084
|
+
success: response.success,
|
|
14085
|
+
accountId: response.accountId,
|
|
14086
|
+
accountName: response.accountName || null,
|
|
14087
|
+
scope: response.scope || 'self',
|
|
14088
|
+
dataMode: response.dataMode,
|
|
14089
|
+
accounts: response.accountIds || [],
|
|
14090
|
+
counts: {
|
|
14091
|
+
agents: counts.agents || 0,
|
|
14092
|
+
lanes: counts.lanes || lanes.length || 0,
|
|
14093
|
+
verificationEnvelopes: counts.verificationEnvelopes || envelopes.length || 0,
|
|
14094
|
+
testRuns: counts.testRuns || testRuns.length || 0,
|
|
14095
|
+
corpusResults: counts.corpusResults || 0,
|
|
14096
|
+
smells: smells.length
|
|
14097
|
+
},
|
|
14098
|
+
topSmells: smells.slice(0, 10).map(slimActivitySmell),
|
|
14099
|
+
currentLanes: lanes.slice(0, 10).map((lane) => ({
|
|
14100
|
+
laneId: lane.laneId || null,
|
|
14101
|
+
accountId: lane.accountId || null,
|
|
14102
|
+
branchName: lane.branchName || null,
|
|
14103
|
+
workspace: lane.workspace || null,
|
|
14104
|
+
stagedCount: lane.stagedCountAsOf || lane.stagedCount || 0,
|
|
14105
|
+
worksetCount: lane.worksetCountAsOf == null ? null : lane.worksetCountAsOf,
|
|
14106
|
+
userEmail: lane.userEmail || null,
|
|
14107
|
+
expiresInSeconds: lane.expiresInSeconds == null ? null : lane.expiresInSeconds
|
|
14108
|
+
})),
|
|
14109
|
+
recentEnvelopes: envelopes.slice(0, 8).map((env) => ({
|
|
14110
|
+
envelopeId: env.envelopeId || null,
|
|
14111
|
+
status: env.status || 'unknown',
|
|
14112
|
+
summary: env.summary || null,
|
|
14113
|
+
packetCount: env.packetCount || 0,
|
|
14114
|
+
currentFailureCount: env.currentFailureCount || 0,
|
|
14115
|
+
health: env.health || null,
|
|
14116
|
+
updatedAt: formatTime(env.updatedAtMs || env.lastPacketAtMs || env.createdAt)
|
|
14117
|
+
})),
|
|
14118
|
+
recentTestRuns: testRuns.slice(0, 8).map((run) => ({
|
|
14119
|
+
taskId: run.taskId || null,
|
|
14120
|
+
testName: run.testName || null,
|
|
14121
|
+
passed: run.passed || 0,
|
|
14122
|
+
total: run.total || 0,
|
|
14123
|
+
branchName: run.branchName || null,
|
|
14124
|
+
workspace: run.workspace || null,
|
|
14125
|
+
ai: corpusAiLabel(run),
|
|
14126
|
+
completedAt: formatTime(run.completedAt || run.startedAt)
|
|
14127
|
+
})),
|
|
14128
|
+
nextActions
|
|
14129
|
+
};
|
|
14130
|
+
}
|
|
14131
|
+
|
|
13883
14132
|
function printActivityInspectSummary(response) {
|
|
13884
14133
|
const subject = response.subjectUser
|
|
13885
14134
|
? ' for ' + (response.subjectUser.email || response.subjectUser.name || ('user ' + response.subjectUser.id))
|
|
@@ -13896,12 +14145,12 @@ function printActivityInspectSummary(response) {
|
|
|
13896
14145
|
(counts.testRuns || 0) + ' test run(s), ' +
|
|
13897
14146
|
(counts.corpusResults || 0) + ' corpus result(s)');
|
|
13898
14147
|
|
|
13899
|
-
const smells = response.smells
|
|
14148
|
+
const smells = sortedActivitySmells(response.smells);
|
|
13900
14149
|
console.log('');
|
|
13901
14150
|
if (!smells.length) {
|
|
13902
14151
|
console.log('Smells: none detected in this slice.');
|
|
13903
14152
|
} else {
|
|
13904
|
-
console.log('
|
|
14153
|
+
console.log('Top smells (' + smells.length + '):');
|
|
13905
14154
|
smells.slice(0, 20).forEach((smell) => {
|
|
13906
14155
|
console.log(' [' + (smell.severity || 'info') + '] ' + (smell.type || 'signal') + ': ' + smell.summary);
|
|
13907
14156
|
const pivots = [
|
|
@@ -13916,6 +14165,12 @@ function printActivityInspectSummary(response) {
|
|
|
13916
14165
|
if (pivots.length) console.log(' ' + pivots.join(' · '));
|
|
13917
14166
|
});
|
|
13918
14167
|
if (smells.length > 20) console.log(' ...' + (smells.length - 20) + ' more; rerun with --json');
|
|
14168
|
+
const actions = compactActivityInspect(response).nextActions;
|
|
14169
|
+
if (actions.length) {
|
|
14170
|
+
console.log('');
|
|
14171
|
+
console.log('Next actions:');
|
|
14172
|
+
actions.forEach((action) => console.log(' - ' + action));
|
|
14173
|
+
}
|
|
13919
14174
|
}
|
|
13920
14175
|
|
|
13921
14176
|
const lanes = response.lanes || [];
|
|
@@ -13978,6 +14233,7 @@ function printActivityInspectSummary(response) {
|
|
|
13978
14233
|
});
|
|
13979
14234
|
}
|
|
13980
14235
|
console.log('');
|
|
14236
|
+
console.log('Compact JSON: remits-cli activity inspect --summary --json');
|
|
13981
14237
|
console.log('Full structured payload: remits-cli activity inspect --json');
|
|
13982
14238
|
}
|
|
13983
14239
|
|
|
@@ -14952,7 +15208,7 @@ function printVerifyHelp() {
|
|
|
14952
15208
|
console.log(' remits-cli verify use <envelopeId>');
|
|
14953
15209
|
console.log(' remits-cli verify current');
|
|
14954
15210
|
console.log(' remits-cli verify clear [--all]');
|
|
14955
|
-
console.log(' remits-cli verify show [--envelope ID] [--json]');
|
|
15211
|
+
console.log(' remits-cli verify show [--envelope ID] [--summary|--compact] [--json]');
|
|
14956
15212
|
console.log(' remits-cli verify status [--envelope ID]');
|
|
14957
15213
|
console.log(' remits-cli verify report [--envelope ID]');
|
|
14958
15214
|
console.log(' remits-cli verify abandon --envelope ID --reason "..."');
|
|
@@ -15022,6 +15278,11 @@ async function main() {
|
|
|
15022
15278
|
// Skip for lifecycle subcommands and help.
|
|
15023
15279
|
const isLifecycleCmd = command === 'listen' || command === 'start' || command === 'stop' || command === 'status' || command === 'whoami' || command === 'doctor' || command === 'agent' || command === 'ticket';
|
|
15024
15280
|
const isHelpCmd = !command || command === 'help' || command === '--help' || wantsHelp;
|
|
15281
|
+
if (!wantsJson && !isHelpCmd && command === 'components') {
|
|
15282
|
+
const commandName = 'components ' + (subcommand || 'command');
|
|
15283
|
+
const problem = platformRepoAccountCommandProblem(process.cwd(), args, commandName, null);
|
|
15284
|
+
if (problem) throw new Error(problem);
|
|
15285
|
+
}
|
|
15025
15286
|
if (!wantsJson && !isHelpCmd && !isLifecycleCmd && !isListenerRunning()) {
|
|
15026
15287
|
try {
|
|
15027
15288
|
const dashboardUrl = await autoStartServiceIfNeeded();
|
|
@@ -15052,7 +15313,7 @@ async function main() {
|
|
|
15052
15313
|
console.log(' remits-cli agent status [--state idle|working|paused] [--ticket ID] [--activity "..."]');
|
|
15053
15314
|
console.log(' remits-cli agent list [--account-id ID] # who else is available');
|
|
15054
15315
|
console.log(' remits-cli agent map [--account-ids 1,4] [--json] # who is EDITING what, where, right now');
|
|
15055
|
-
console.log(' remits-cli activity inspect [--account-id ID] [--scope self|children] [--user-email E] [--json]');
|
|
15316
|
+
console.log(' remits-cli activity inspect [--account-id ID] [--scope self|children] [--user-email E] [--summary|--compact] [--json]');
|
|
15056
15317
|
console.log(' remits-cli agent release # stop receiving tickets now');
|
|
15057
15318
|
console.log(' remits-cli start [--foreground true] [--port 8787] # human dashboard in the browser');
|
|
15058
15319
|
console.log(' remits-cli stop');
|
|
@@ -15103,7 +15364,7 @@ async function main() {
|
|
|
15103
15364
|
console.log('A WORKSPACE is an optional second isolation axis for staging, alongside the git branch.');
|
|
15104
15365
|
console.log('Staging is keyed by (account, cli user, branch, workspace) — and account and user are fixed');
|
|
15105
15366
|
console.log('for a given repo, so without a workspace the branch is the ONLY axis. That is why two coding');
|
|
15106
|
-
console.log('agents in two
|
|
15367
|
+
console.log('agents in two checkouts without their own workspace overwrite each other: `components stage` uploads');
|
|
15107
15368
|
console.log('the whole repo and replaces the lane wholesale.');
|
|
15108
15369
|
console.log('');
|
|
15109
15370
|
console.log('A workspace isolates staging WITHOUT changing anything else:');
|
|
@@ -15111,13 +15372,13 @@ async function main() {
|
|
|
15111
15372
|
console.log(' - the run still resolves whatever committed ComponentVariant branch the account subscribes to');
|
|
15112
15373
|
console.log(' - only which staged entries shadow them changes');
|
|
15113
15374
|
console.log('');
|
|
15114
|
-
console.log('Typical setup, one
|
|
15115
|
-
console.log(' git
|
|
15375
|
+
console.log('Typical setup, one clone per agent, all on the same branch:');
|
|
15376
|
+
console.log(' git clone <repo-url> ../ms-agent-a');
|
|
15377
|
+
console.log(' cd ../ms-agent-a');
|
|
15116
15378
|
console.log(' git switch forked');
|
|
15117
15379
|
console.log(' git pull --ff-only origin forked');
|
|
15118
15380
|
console.log(' git rev-list --left-right --count HEAD...origin/forked # must print: 0 0');
|
|
15119
|
-
console.log('
|
|
15120
|
-
console.log(' cd ../ms-agent-a && remits-cli workspace use --auto');
|
|
15381
|
+
console.log(' remits-cli workspace use --auto');
|
|
15121
15382
|
console.log(' remits-cli components status # branch world + staging lane + other lanes');
|
|
15122
15383
|
console.log(' remits-cli components stage # isolated lane; nobody else sees it');
|
|
15123
15384
|
console.log(' remits-cli test run --test 42 # resolves this lane over the forked variants');
|
|
@@ -15126,7 +15387,8 @@ async function main() {
|
|
|
15126
15387
|
console.log('Precedence: --workspace > REMITS_WORKSPACE > .remits-cli/workspace > shared default lane');
|
|
15127
15388
|
console.log('Use --no-workspace on a single command to target the shared lane without clearing the file.');
|
|
15128
15389
|
console.log('');
|
|
15129
|
-
console.log('`.remits-cli/workspace` is per-checkout and gitignored, so
|
|
15390
|
+
console.log('`.remits-cli/workspace` is per-checkout and gitignored, so each clone keeps its own lane.');
|
|
15391
|
+
console.log('Avoid same-branch worktrees for concurrent agents: they share the branch ref, so one pull moves HEAD under the others, and `components commit` refuses there.');
|
|
15130
15392
|
process.exit(0);
|
|
15131
15393
|
}
|
|
15132
15394
|
|
|
@@ -15277,7 +15539,7 @@ async function main() {
|
|
|
15277
15539
|
|
|
15278
15540
|
if (command === 'activity') {
|
|
15279
15541
|
if (wantsHelp || !subcommand) {
|
|
15280
|
-
console.log('Usage: remits-cli activity inspect [--account-id ID] [--scope self|children] [--user-id ID|--user-email EMAIL] [--limit N] [--json]');
|
|
15542
|
+
console.log('Usage: remits-cli activity inspect [--account-id ID] [--scope self|children] [--user-id ID|--user-email EMAIL] [--limit N] [--summary|--compact] [--json]');
|
|
15281
15543
|
console.log('');
|
|
15282
15544
|
console.log('Read-only workstream inspection for agent/operator review. Joins current staging lanes,');
|
|
15283
15545
|
console.log('verification envelopes, durable test runs, corpus measurements, live agent presence,');
|