@pellux/goodvibes-agent 0.1.116 → 0.1.117
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/CHANGELOG.md +41 -663
- package/README.md +38 -52
- package/dist/package/main.js +37826 -35924
- package/docs/README.md +5 -4
- package/docs/{connected-services.md → connected-host.md} +18 -10
- package/docs/getting-started.md +41 -44
- package/docs/release-and-publishing.md +6 -4
- package/package.json +3 -3
- package/src/agent/behavior-discovery-summary.ts +1 -3
- package/src/agent/persona-discovery.ts +1 -3
- package/src/agent/persona-registry.ts +5 -3
- package/src/agent/reminder-schedule-format.ts +6 -6
- package/src/agent/reminder-schedule.ts +1 -1
- package/src/agent/routine-registry.ts +43 -4
- package/src/agent/routine-schedule-format.ts +6 -6
- package/src/agent/routine-schedule-promotion.ts +1 -1
- package/src/agent/routine-schedule-receipts.ts +1 -1
- package/src/agent/runtime-profile-starters.ts +3 -3
- package/src/agent/runtime-profile.ts +78 -0
- package/src/agent/skill-registry.ts +190 -13
- package/src/cli/agent-knowledge-command.ts +2 -2
- package/src/cli/agent-knowledge-format.ts +2 -2
- package/src/cli/agent-knowledge-runtime.ts +1 -1
- package/src/cli/bundle-command.ts +1 -1
- package/src/cli/entrypoint.ts +16 -7
- package/src/cli/help.ts +26 -19
- package/src/cli/local-library-command.ts +75 -21
- package/src/cli/management-commands.ts +7 -6
- package/src/cli/management.ts +6 -51
- package/src/cli/parser.ts +23 -2
- package/src/cli/profiles-command.ts +119 -1
- package/src/cli/routines-command.ts +139 -11
- package/src/cli/service-posture.ts +11 -11
- package/src/cli/status.ts +21 -25
- package/src/input/agent-workspace-access-command-editor-submission.ts +149 -0
- package/src/input/agent-workspace-access-command-editors.ts +170 -0
- package/src/input/agent-workspace-activation.ts +2 -1
- package/src/input/agent-workspace-basic-command-editor-submission.ts +345 -92
- package/src/input/agent-workspace-basic-command-editors.ts +480 -7
- package/src/input/agent-workspace-categories.ts +175 -15
- package/src/input/agent-workspace-channel-command-editor-submission.ts +49 -0
- package/src/input/agent-workspace-channel-command-editors.ts +47 -0
- package/src/input/agent-workspace-command-editor.ts +23 -1
- package/src/input/agent-workspace-delegation-editor-submission.ts +55 -0
- package/src/input/agent-workspace-editors.ts +27 -0
- package/src/input/agent-workspace-knowledge-command-editor-submission.ts +132 -0
- package/src/input/agent-workspace-knowledge-command-editors.ts +110 -0
- package/src/input/agent-workspace-learned-behavior.ts +67 -0
- package/src/input/agent-workspace-library-command-editor-submission.ts +50 -0
- package/src/input/agent-workspace-library-command-editors.ts +35 -0
- package/src/input/agent-workspace-mcp-command-editor-submission.ts +95 -0
- package/src/input/agent-workspace-memory-command-editor-submission.ts +232 -0
- package/src/input/agent-workspace-memory-command-editors.ts +180 -0
- package/src/input/agent-workspace-navigation.ts +45 -0
- package/src/input/agent-workspace-notify-editor-submission.ts +107 -0
- package/src/input/agent-workspace-operations-command-editor-submission.ts +146 -0
- package/src/input/agent-workspace-operations-command-editors.ts +119 -0
- package/src/input/agent-workspace-provider-command-editor-submission.ts +155 -0
- package/src/input/agent-workspace-provider-command-editors.ts +93 -0
- package/src/input/agent-workspace-requirements.ts +11 -0
- package/src/input/agent-workspace-secret-editor-submission.ts +153 -0
- package/src/input/agent-workspace-session-command-editor-submission.ts +199 -0
- package/src/input/agent-workspace-session-command-editors.ts +249 -0
- package/src/input/agent-workspace-setup.ts +24 -14
- package/src/input/agent-workspace-skill-bundle-command-editor-submission.ts +101 -0
- package/src/input/agent-workspace-skill-bundle-command-editors.ts +110 -0
- package/src/input/agent-workspace-snapshot.ts +50 -8
- package/src/input/agent-workspace-task-command-editor-submission.ts +61 -0
- package/src/input/agent-workspace-task-command-editors.ts +47 -0
- package/src/input/agent-workspace-types.ts +120 -0
- package/src/input/agent-workspace-voice-media.ts +1 -1
- package/src/input/agent-workspace-workplan-editor-submission.ts +153 -0
- package/src/input/agent-workspace.ts +47 -37
- package/src/input/command-registry.ts +1 -1
- package/src/input/commands/agent-runtime-profile-runtime.ts +89 -4
- package/src/input/commands/agent-skills-runtime.ts +76 -12
- package/src/input/commands/agent-workspace-runtime.ts +4 -3
- package/src/input/commands/brief-runtime.ts +38 -9
- package/src/input/commands/channels-runtime.ts +3 -3
- package/src/input/commands/compat-runtime.ts +32 -0
- package/src/input/commands/health-runtime.ts +22 -24
- package/src/input/commands/knowledge.ts +26 -5
- package/src/input/commands/local-provider-runtime.ts +7 -3
- package/src/input/commands/local-setup-review.ts +4 -14
- package/src/input/commands/mcp-runtime.ts +8 -12
- package/src/input/commands/operator-runtime.ts +8 -67
- package/src/input/commands/personas-runtime.ts +1 -1
- package/src/input/commands/platform-access-runtime.ts +7 -70
- package/src/input/commands/policy-dispatch.ts +1 -1
- package/src/input/commands/policy.ts +1 -5
- package/src/input/commands/product-runtime.ts +2 -2
- package/src/input/commands/qrcode-runtime.ts +6 -4
- package/src/input/commands/routines-runtime.ts +44 -6
- package/src/input/commands/runtime-services.ts +1 -14
- package/src/input/commands/security-runtime.ts +3 -8
- package/src/input/commands/session-content.ts +1 -1
- package/src/input/commands/session-workflow.ts +5 -14
- package/src/input/commands/shell-core.ts +8 -2
- package/src/input/commands/subscription-runtime.ts +1 -6
- package/src/input/commands/support-bundle-runtime.ts +53 -0
- package/src/input/commands/tasks-runtime.ts +2 -2
- package/src/input/commands.ts +4 -0
- package/src/input/feed-context-factory.ts +0 -1
- package/src/input/handler-content-actions.ts +0 -25
- package/src/input/handler-feed.ts +0 -2
- package/src/input/handler-interactions.ts +2 -31
- package/src/input/handler-onboarding.ts +29 -12
- package/src/input/handler-shortcuts.ts +1 -3
- package/src/input/handler.ts +4 -7
- package/src/input/keybindings.ts +9 -9
- package/src/input/mcp-workspace.ts +90 -26
- package/src/input/onboarding/handler-onboarding-routes.ts +3 -1
- package/src/input/onboarding/onboarding-wizard-apply.ts +49 -0
- package/src/input/onboarding/onboarding-wizard-helpers.ts +1 -1
- package/src/input/onboarding/onboarding-wizard-operator-steps.ts +81 -3
- package/src/input/onboarding/onboarding-wizard-steps.ts +14 -7
- package/src/input/onboarding/onboarding-wizard-types.ts +1 -0
- package/src/input/onboarding/onboarding-wizard.ts +19 -2
- package/src/input/profile-picker-modal.ts +2 -2
- package/src/input/settings-modal-agent-policy.ts +6 -6
- package/src/input/settings-modal-subscriptions.ts +3 -3
- package/src/input/settings-modal.ts +14 -14
- package/src/main.ts +0 -2
- package/src/panels/automation-control-panel.ts +3 -3
- package/src/panels/builtin/agent.ts +1 -1
- package/src/panels/builtin/operations.ts +2 -2
- package/src/panels/builtin/session.ts +26 -18
- package/src/panels/builtin/shared.ts +6 -6
- package/src/panels/project-planning-panel.ts +1 -1
- package/src/panels/provider-health-domains.ts +3 -3
- package/src/panels/qr-panel.ts +44 -20
- package/src/panels/subscription-panel.ts +3 -3
- package/src/panels/system-messages-panel.ts +2 -2
- package/src/panels/tasks-panel.ts +4 -4
- package/src/planning/project-planning-coordinator.ts +2 -2
- package/src/renderer/agent-workspace.ts +26 -5
- package/src/renderer/block-actions.ts +1 -3
- package/src/renderer/help-overlay.ts +13 -8
- package/src/renderer/mcp-workspace.ts +32 -13
- package/src/renderer/model-picker-overlay.ts +0 -1
- package/src/renderer/model-workspace.ts +0 -2
- package/src/renderer/onboarding/onboarding-wizard.ts +20 -4
- package/src/renderer/panel-picker-overlay.ts +1 -1
- package/src/renderer/profile-picker-modal.ts +2 -2
- package/src/renderer/settings-modal-helpers.ts +23 -23
- package/src/renderer/settings-modal.ts +18 -18
- package/src/renderer/system-message.ts +1 -1
- package/src/runtime/agent-runtime-events.ts +129 -0
- package/src/runtime/bootstrap-command-parts.ts +3 -2
- package/src/runtime/bootstrap-core.ts +4 -64
- package/src/runtime/bootstrap-shell.ts +42 -4
- package/src/runtime/bootstrap.ts +8 -27
- package/src/runtime/connected-host-auth.ts +42 -0
- package/src/runtime/diagnostics/panels/panel-resources.ts +1 -1
- package/src/runtime/index.ts +1 -5
- package/src/runtime/onboarding/apply.ts +213 -0
- package/src/runtime/onboarding/derivation.ts +5 -5
- package/src/runtime/onboarding/snapshot.ts +2 -2
- package/src/runtime/onboarding/types.ts +26 -1
- package/src/runtime/onboarding/verify.ts +81 -2
- package/src/runtime/operator-token-cleanup.ts +2 -2
- package/src/runtime/services.ts +27 -12
- package/src/shell/service-settings-sync.ts +7 -7
- package/src/shell/ui-openers.ts +27 -38
- package/src/tools/agent-local-registry-tool.ts +10 -4
- package/src/tools/agent-tool-policy-guard.ts +5 -7
- package/src/version.ts +1 -1
- package/src/cli/package-verification.ts +0 -274
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'node:child_process';
|
|
2
|
-
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { CommandRegistry } from '../input/command-registry.ts';
|
|
5
|
-
import { registerBuiltinCommands } from '../input/commands.ts';
|
|
6
|
-
|
|
7
|
-
export interface PackageCliBinVerification {
|
|
8
|
-
readonly command: 'goodvibes-agent';
|
|
9
|
-
readonly target: string;
|
|
10
|
-
readonly exists: boolean;
|
|
11
|
-
readonly executable: boolean;
|
|
12
|
-
readonly usesBunShebang: boolean;
|
|
13
|
-
readonly hasSourceEntrypoint: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface PackageCliVerificationReport {
|
|
17
|
-
readonly packageName: string;
|
|
18
|
-
readonly version: string;
|
|
19
|
-
readonly bins: readonly PackageCliBinVerification[];
|
|
20
|
-
readonly tarball: {
|
|
21
|
-
readonly entryCount: number;
|
|
22
|
-
readonly unpackedSize: number;
|
|
23
|
-
readonly requiredPathsPresent: readonly string[];
|
|
24
|
-
readonly forbiddenPaths: readonly string[];
|
|
25
|
-
};
|
|
26
|
-
readonly packageFacingText: {
|
|
27
|
-
readonly checkedPaths: readonly string[];
|
|
28
|
-
readonly failures: readonly string[];
|
|
29
|
-
};
|
|
30
|
-
readonly issues: readonly string[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const REQUIRED_BIN_COMMANDS = ['goodvibes-agent'] as const;
|
|
34
|
-
const REQUIRED_TARBALL_PATHS = [
|
|
35
|
-
'README.md',
|
|
36
|
-
'CHANGELOG.md',
|
|
37
|
-
'LICENSE',
|
|
38
|
-
'package.json',
|
|
39
|
-
'src/main.ts',
|
|
40
|
-
'dist/package/main.js',
|
|
41
|
-
'bin/goodvibes-agent.ts',
|
|
42
|
-
'tsconfig.json',
|
|
43
|
-
'docs/README.md',
|
|
44
|
-
'docs/getting-started.md',
|
|
45
|
-
'docs/connected-services.md',
|
|
46
|
-
'docs/release-and-publishing.md',
|
|
47
|
-
] as const;
|
|
48
|
-
const FORBIDDEN_TARBALL_PREFIXES = ['.github/', 'src/test/', 'src/.test/', '.goodvibes/', 'vendor/'] as const;
|
|
49
|
-
const FORBIDDEN_TARBALL_DOCS = [
|
|
50
|
-
['docs/cloud', 'flare-batch.md'].join(''),
|
|
51
|
-
['docs/home', 'assistant-surface.md'].join(''),
|
|
52
|
-
'docs/wrfc/',
|
|
53
|
-
] as const;
|
|
54
|
-
const FORBIDDEN_TARBALL_FILES = new Set([
|
|
55
|
-
'src/panels/agent-inspector-panel.ts',
|
|
56
|
-
'src/panels/agent-inspector-shared.ts',
|
|
57
|
-
'src/panels/agent-logs-panel.ts',
|
|
58
|
-
'src/panels/agent-logs-shared.ts',
|
|
59
|
-
'src/tools/wrfc-agent-guard.ts',
|
|
60
|
-
'src/renderer/agent-detail-modal.ts',
|
|
61
|
-
'src/renderer/process-summary.ts',
|
|
62
|
-
]);
|
|
63
|
-
const PACKAGE_FACING_TEXT_PATHS = [
|
|
64
|
-
'README.md',
|
|
65
|
-
'CHANGELOG.md',
|
|
66
|
-
'docs/README.md',
|
|
67
|
-
'docs/getting-started.md',
|
|
68
|
-
'docs/connected-services.md',
|
|
69
|
-
'docs/release-and-publishing.md',
|
|
70
|
-
] as const;
|
|
71
|
-
const PACKAGE_FACING_FORBIDDEN_TEXT = [
|
|
72
|
-
['/api/', 'knowledge'].join(''),
|
|
73
|
-
['/api/home', 'assistant'].join(''),
|
|
74
|
-
['home', 'assistant.home', 'Graph'].join(''),
|
|
75
|
-
['include', 'AllSpaces'].join(''),
|
|
76
|
-
['knowledge', 'SpaceId'].join(''),
|
|
77
|
-
['@pellux/goodvibes-', 'tui'].join(''),
|
|
78
|
-
['@pellux/goodvibes-', 'daemon'].join(''),
|
|
79
|
-
['goodvibes-', 'daemon'].join(''),
|
|
80
|
-
['~/.goodvibes/', 'tui'].join(''),
|
|
81
|
-
['Home', ' Assistant'].join(''),
|
|
82
|
-
['Home', 'Graph'].join(''),
|
|
83
|
-
['Cloud', 'flare'].join(''),
|
|
84
|
-
['Open', 'Claw'].join(''),
|
|
85
|
-
['Her', 'mes'].join(''),
|
|
86
|
-
['cap', 'abilities audit'].join(''),
|
|
87
|
-
['cap', 'abilities command'].join(''),
|
|
88
|
-
['near', '-fork'].join(''),
|
|
89
|
-
['Optional ', 'Browser Access'].join(''),
|
|
90
|
-
['Optional ', 'Other-Device Access'].join(''),
|
|
91
|
-
['Optional ', 'Incoming Events'].join(''),
|
|
92
|
-
['Service ', '& Network'].join(''),
|
|
93
|
-
['Surfaces ', '& Integrations'].join(''),
|
|
94
|
-
['runtime', '-isolation'].join(''),
|
|
95
|
-
['goodvibes-agent', 'serve'].join(' '),
|
|
96
|
-
['goodvibes-agent', 'service'].join(' '),
|
|
97
|
-
['goodvibes-agent', 'services'].join(' '),
|
|
98
|
-
['goodvibes-agent', 'surfaces'].join(' '),
|
|
99
|
-
['goodvibes-agent', 'surface'].join(' '),
|
|
100
|
-
['goodvibes-agent', 'listener'].join(' '),
|
|
101
|
-
['goodvibes-agent', 'control-plane'].join(' '),
|
|
102
|
-
['goodvibes-agent', 'remote'].join(' '),
|
|
103
|
-
['goodvibes-agent', 'bridge'].join(' '),
|
|
104
|
-
['goodvibes-agent', 'web'].join(' '),
|
|
105
|
-
['goodvibes-agent', 'launch'].join(' '),
|
|
106
|
-
['goodvibes-agent', 'start'].join(' '),
|
|
107
|
-
['tui ', '[path]'].join(''),
|
|
108
|
-
['tui', '|launch'].join(''),
|
|
109
|
-
['tui', '|launch|start'].join(''),
|
|
110
|
-
'Every plan must have a multi-agent execution strategy',
|
|
111
|
-
'NEVER skip WRFC',
|
|
112
|
-
'ALWAYS work in parallel when implementing a plan',
|
|
113
|
-
'PRIMARY GOAL: Fully complete and functional code',
|
|
114
|
-
'You are a code reviewer for the WRFC',
|
|
115
|
-
'ReviewerReport',
|
|
116
|
-
'"wrfcId"',
|
|
117
|
-
] as const;
|
|
118
|
-
const PACKAGE_FACING_REQUIRED_TEXT: readonly {
|
|
119
|
-
readonly path: typeof PACKAGE_FACING_TEXT_PATHS[number];
|
|
120
|
-
readonly required: readonly string[];
|
|
121
|
-
}[] = [
|
|
122
|
-
{ path: 'README.md', required: ['/api/goodvibes-agent/knowledge', 'bun add -g @pellux/goodvibes-agent'] },
|
|
123
|
-
{ path: 'docs/README.md', required: ['/api/goodvibes-agent/knowledge'] },
|
|
124
|
-
{ path: 'docs/getting-started.md', required: ['/api/goodvibes-agent/knowledge', 'bun add -g @pellux/goodvibes-agent'] },
|
|
125
|
-
{ path: 'docs/connected-services.md', required: ['/api/goodvibes-agent/knowledge'] },
|
|
126
|
-
{ path: 'docs/release-and-publishing.md', required: ['/api/goodvibes-agent/knowledge', 'bun add -g @pellux/goodvibes-agent'] },
|
|
127
|
-
];
|
|
128
|
-
const NON_COMMAND_ROUTE_ROOTS = new Set(['api', 'status']);
|
|
129
|
-
|
|
130
|
-
function readPackageJson(root: string): Record<string, unknown> {
|
|
131
|
-
return JSON.parse(readFileSync(join(root, 'package.json'), 'utf-8')) as Record<string, unknown>;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function buildRegisteredSlashCommandNames(): ReadonlySet<string> {
|
|
135
|
-
const registry = new CommandRegistry();
|
|
136
|
-
registerBuiltinCommands(registry);
|
|
137
|
-
const names = new Set<string>();
|
|
138
|
-
for (const command of registry.list()) {
|
|
139
|
-
names.add(command.name);
|
|
140
|
-
for (const alias of command.aliases ?? []) names.add(alias);
|
|
141
|
-
}
|
|
142
|
-
return names;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function verifyPackageFacingSlashCommands(path: string, content: string, registeredCommands: ReadonlySet<string>): readonly string[] {
|
|
146
|
-
const failures: string[] = [];
|
|
147
|
-
const commandPattern = /(^|[\s`([])\/([a-z][a-z0-9_-]*)(?=$|[\s`.,;:)\]])/g;
|
|
148
|
-
const lines = content.split(/\r?\n/);
|
|
149
|
-
for (let lineIndex = 0; lineIndex < lines.length; lineIndex += 1) {
|
|
150
|
-
const line = lines[lineIndex] ?? '';
|
|
151
|
-
commandPattern.lastIndex = 0;
|
|
152
|
-
for (let match = commandPattern.exec(line); match !== null; match = commandPattern.exec(line)) {
|
|
153
|
-
const root = match[2] ?? '';
|
|
154
|
-
if (NON_COMMAND_ROUTE_ROOTS.has(root)) continue;
|
|
155
|
-
if (registeredCommands.has(root)) continue;
|
|
156
|
-
failures.push(`package-facing text ${path}:${lineIndex + 1} references unknown Agent slash command: /${root}`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return failures;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function hasExecutableBit(path: string): boolean {
|
|
163
|
-
return existsSync(path) && (statSync(path).mode & 0o111) !== 0;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function verifyBin(root: string, command: typeof REQUIRED_BIN_COMMANDS[number], target: string | undefined): PackageCliBinVerification {
|
|
167
|
-
const binPath = target ? join(root, target) : '';
|
|
168
|
-
const source = target && existsSync(binPath) ? readFileSync(binPath, 'utf-8') : '';
|
|
169
|
-
return {
|
|
170
|
-
command,
|
|
171
|
-
target: target ?? '',
|
|
172
|
-
exists: Boolean(target) && existsSync(binPath),
|
|
173
|
-
executable: Boolean(target) && hasExecutableBit(binPath),
|
|
174
|
-
usesBunShebang: source.startsWith('#!/usr/bin/env bun'),
|
|
175
|
-
hasSourceEntrypoint: source.includes('dist') && source.includes('package') && source.includes('main.js'),
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function registryPackDryRun(root: string): { readonly files: readonly string[]; readonly entryCount: number; readonly unpackedSize: number } {
|
|
180
|
-
execSync('bun run build:package-runtime', {
|
|
181
|
-
cwd: root,
|
|
182
|
-
stdio: 'inherit',
|
|
183
|
-
});
|
|
184
|
-
const raw = execSync('npm pack --json --dry-run', {
|
|
185
|
-
cwd: root,
|
|
186
|
-
encoding: 'utf-8',
|
|
187
|
-
stdio: ['ignore', 'pipe', 'inherit'],
|
|
188
|
-
});
|
|
189
|
-
const [packResult] = JSON.parse(raw) as Array<{ files?: Array<{ path?: string }>; entryCount?: number; unpackedSize?: number }>;
|
|
190
|
-
return {
|
|
191
|
-
files: Array.isArray(packResult?.files) ? packResult.files.map((entry) => String(entry.path ?? '')) : [],
|
|
192
|
-
entryCount: Number(packResult?.entryCount ?? 0),
|
|
193
|
-
unpackedSize: Number(packResult?.unpackedSize ?? 0),
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export function verifyPackageFacingText(root: string): { readonly checkedPaths: readonly string[]; readonly failures: readonly string[] } {
|
|
198
|
-
const failures: string[] = [];
|
|
199
|
-
const registeredCommands = buildRegisteredSlashCommandNames();
|
|
200
|
-
for (const path of PACKAGE_FACING_TEXT_PATHS) {
|
|
201
|
-
const absolutePath = join(root, path);
|
|
202
|
-
if (!existsSync(absolutePath)) {
|
|
203
|
-
failures.push(`package-facing text is missing: ${path}`);
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
const content = readFileSync(absolutePath, 'utf-8');
|
|
207
|
-
if (path !== 'CHANGELOG.md') {
|
|
208
|
-
failures.push(...verifyPackageFacingSlashCommands(path, content, registeredCommands));
|
|
209
|
-
}
|
|
210
|
-
for (const forbidden of PACKAGE_FACING_FORBIDDEN_TEXT) {
|
|
211
|
-
if (content.includes(forbidden)) {
|
|
212
|
-
failures.push(`package-facing text ${path} contains forbidden default/TUI route or policy: ${forbidden}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const requirement = PACKAGE_FACING_REQUIRED_TEXT.find((entry) => entry.path === path);
|
|
216
|
-
if (requirement) {
|
|
217
|
-
for (const required of requirement.required) {
|
|
218
|
-
if (!content.includes(required)) {
|
|
219
|
-
failures.push(`package-facing text ${path} is missing required Agent route/policy text: ${required}`);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return {
|
|
225
|
-
checkedPaths: PACKAGE_FACING_TEXT_PATHS,
|
|
226
|
-
failures,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function verifyPackageCliInstall(root: string): PackageCliVerificationReport {
|
|
231
|
-
const pkg = readPackageJson(root);
|
|
232
|
-
const bin = pkg.bin && typeof pkg.bin === 'object' ? pkg.bin as Record<string, string | undefined> : {};
|
|
233
|
-
const bins = REQUIRED_BIN_COMMANDS.map((command) => verifyBin(root, command, bin[command]));
|
|
234
|
-
const pack = registryPackDryRun(root);
|
|
235
|
-
const requiredPathsPresent = REQUIRED_TARBALL_PATHS.filter((path) => pack.files.includes(path));
|
|
236
|
-
const forbiddenPaths = pack.files.filter((path) => {
|
|
237
|
-
if (FORBIDDEN_TARBALL_PREFIXES.some((prefix) => path.startsWith(prefix))) return true;
|
|
238
|
-
if (FORBIDDEN_TARBALL_FILES.has(path)) return true;
|
|
239
|
-
return FORBIDDEN_TARBALL_DOCS.some((docPath) => path === docPath || path.startsWith(docPath));
|
|
240
|
-
});
|
|
241
|
-
const issues: string[] = [];
|
|
242
|
-
const packageFacingText = verifyPackageFacingText(root);
|
|
243
|
-
|
|
244
|
-
for (const item of bins) {
|
|
245
|
-
if (!item.target) issues.push(`package.json bin is missing ${item.command}.`);
|
|
246
|
-
if (!item.exists) issues.push(`bin target does not exist: ${item.command} -> ${item.target}`);
|
|
247
|
-
if (!item.executable) issues.push(`bin target is not executable: ${item.command} -> ${item.target}`);
|
|
248
|
-
if (!item.usesBunShebang) issues.push(`bin target does not use Bun shebang: ${item.command} -> ${item.target}`);
|
|
249
|
-
if (!item.hasSourceEntrypoint) issues.push(`bin target does not load the packaged Agent runtime: ${item.command}`);
|
|
250
|
-
}
|
|
251
|
-
for (const path of REQUIRED_TARBALL_PATHS) {
|
|
252
|
-
if (!pack.files.includes(path)) issues.push(`registry tarball missing required path: ${path}`);
|
|
253
|
-
}
|
|
254
|
-
for (const path of forbiddenPaths) {
|
|
255
|
-
issues.push(`registry tarball includes forbidden path: ${path}`);
|
|
256
|
-
}
|
|
257
|
-
for (const failure of packageFacingText.failures) {
|
|
258
|
-
issues.push(failure);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
packageName: String(pkg.name ?? ''),
|
|
263
|
-
version: String(pkg.version ?? ''),
|
|
264
|
-
bins,
|
|
265
|
-
tarball: {
|
|
266
|
-
entryCount: pack.entryCount,
|
|
267
|
-
unpackedSize: pack.unpackedSize,
|
|
268
|
-
requiredPathsPresent,
|
|
269
|
-
forbiddenPaths,
|
|
270
|
-
},
|
|
271
|
-
packageFacingText,
|
|
272
|
-
issues,
|
|
273
|
-
};
|
|
274
|
-
}
|