@notis_ai/cli 0.2.0-beta.16.1 → 0.2.0-beta.160.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/README.md +433 -133
- package/config/notis_app_boundary_rules.json +50 -0
- package/config/notis_app_design_rules.json +135 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +18672 -0
- package/dist/base-skills/notis-apps/SKILL.md +70 -0
- package/dist/base-skills/notis-apps/references/architecture.md +164 -0
- package/dist/base-skills/notis-apps/references/context.md +81 -0
- package/dist/base-skills/notis-apps/references/design.md +165 -0
- package/dist/base-skills/notis-apps/references/reading.md +89 -0
- package/dist/base-skills/notis-apps/references/release.md +99 -0
- package/dist/base-skills/notis-apps/references/sdk.md +62 -0
- package/dist/base-skills/notis-apps/references/troubleshooting.md +23 -0
- package/dist/base-skills/notis-cli/SKILL.md +140 -0
- package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
- package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
- package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
- package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
- package/dist/base-skills/notis-query/SKILL.md +67 -0
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
- package/dist/base-skills/notis-query/references/documents.md +50 -0
- package/dist/base-skills/notis-query/references/query.md +543 -0
- package/dist/skill-sync/index.js +1626 -0
- package/dist/skill-sync/index.js.map +7 -0
- package/dist/skill-sync-worker.mjs +2990 -0
- package/package.json +16 -6
- package/skills/notis-apps/cli.md +313 -0
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
- package/skills/notis-onboarding/BRIEF.md +129 -0
- package/skills/notis-query/cli.md +39 -0
- package/src/agent-hook-entry.js +5 -0
- package/src/cli.js +294 -25
- package/src/command-specs/agents.js +392 -0
- package/src/command-specs/apps.js +1470 -202
- package/src/command-specs/auth.js +114 -137
- package/src/command-specs/diagnostics.js +716 -0
- package/src/command-specs/handover.js +374 -0
- package/src/command-specs/helpers.js +84 -82
- package/src/command-specs/index.js +25 -6
- package/src/command-specs/meta.js +150 -18
- package/src/command-specs/onboarding.js +290 -0
- package/src/command-specs/profile.js +358 -0
- package/src/command-specs/reports.js +86 -0
- package/src/command-specs/skills.js +75 -0
- package/src/command-specs/smoke.js +386 -0
- package/src/command-specs/tools.js +455 -139
- package/src/runtime/agent-browser.js +632 -0
- package/src/runtime/agent-memory-state.js +126 -0
- package/src/runtime/agent-setup.js +383 -0
- package/src/runtime/app-boundary-validator.js +404 -0
- package/src/runtime/app-changelog.js +79 -0
- package/src/runtime/app-platform.js +2633 -210
- package/src/runtime/app-registry-scaffolds.js +367 -0
- package/src/runtime/app-test-server.js +292 -0
- package/src/runtime/assets/store-screenshot-dark.png +0 -0
- package/src/runtime/auth-recovery.js +110 -0
- package/src/runtime/base-skills.d.ts +20 -0
- package/src/runtime/base-skills.js +167 -0
- package/src/runtime/channel.js +133 -0
- package/src/runtime/delegated-context.js +68 -0
- package/src/runtime/errors.js +1 -0
- package/src/runtime/git.js +233 -0
- package/src/runtime/login-listener.js +15 -0
- package/src/runtime/oauth.js +2622 -0
- package/src/runtime/output.js +37 -5
- package/src/runtime/ports.js +31 -0
- package/src/runtime/profiles.js +906 -55
- package/src/runtime/skill-sync/cloud-client.ts +99 -0
- package/src/runtime/skill-sync/index.ts +697 -0
- package/src/runtime/skill-sync/local-scanner.ts +1046 -0
- package/src/runtime/skill-sync/symlink-manager.ts +433 -0
- package/src/runtime/skill-sync/sync-plan.ts +22 -0
- package/src/runtime/skill-sync/types.ts +110 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/runtime/store-screenshot.js +143 -0
- package/src/runtime/sync-skills.d.ts +37 -0
- package/src/runtime/sync-skills.js +231 -0
- package/src/runtime/telemetry.js +92 -0
- package/src/runtime/transport.js +324 -45
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +50 -0
- package/template/.harness/index.html.tmpl +430 -0
- package/template/CHANGELOG.md +5 -0
- package/template/app/layout.tsx +5 -2
- package/template/app/page.tsx +49 -42
- package/template/components/page-heading.tsx +23 -0
- package/template/components/ui/badge.tsx +7 -4
- package/template/components/ui/card.tsx +24 -11
- package/template/components/ui/native-select.tsx +24 -0
- package/template/notis.config.ts +24 -6
- package/template/package-lock.json +4137 -0
- package/template/package.json +5 -5
- package/template/packages/{notis-sdk → sdk}/package.json +13 -3
- package/template/packages/sdk/src/agentContext.ts +36 -0
- package/template/packages/sdk/src/components/DocumentEditor.tsx +103 -0
- package/template/packages/sdk/src/components/Markdown.tsx +60 -0
- package/template/packages/sdk/src/components/MarkdownEditor.tsx +121 -0
- package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +285 -0
- package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
- package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/template/packages/sdk/src/components/NotisCommentBoundary.tsx +172 -0
- package/template/packages/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
- package/template/packages/sdk/src/components/ShortcutHints.tsx +56 -0
- package/template/packages/sdk/src/components/Skeleton.tsx +24 -0
- package/template/packages/sdk/src/config.ts +257 -0
- package/template/packages/sdk/src/documents.ts +256 -0
- package/template/packages/sdk/src/hooks/useActiveResource.ts +19 -0
- package/template/packages/sdk/src/hooks/useAgentContext.ts +23 -0
- package/template/packages/sdk/src/hooks/useCloudComputer.ts +64 -0
- package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +836 -0
- package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +49 -0
- package/template/packages/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
- package/template/packages/sdk/src/hooks/useDocument.ts +43 -0
- package/template/packages/sdk/src/hooks/useDocuments.ts +84 -0
- package/template/packages/sdk/src/hooks/useHandover.ts +78 -0
- package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/template/packages/sdk/src/hooks/useMultiSelect.ts +95 -0
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +10 -4
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +11 -8
- package/template/packages/sdk/src/hooks/useQuery.ts +71 -0
- package/template/packages/sdk/src/hooks/useTool.ts +65 -0
- package/template/packages/sdk/src/hooks/useToolQuery.ts +12 -0
- package/template/packages/sdk/src/hooks/useTopBarSearch.ts +81 -0
- package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/template/packages/sdk/src/index.ts +161 -0
- package/template/packages/sdk/src/interactions/actions.ts +59 -0
- package/template/packages/sdk/src/interactions/shortcuts.tsx +694 -0
- package/template/packages/sdk/src/interactions/visibility.ts +13 -0
- package/template/packages/sdk/src/interactions.ts +45 -0
- package/template/packages/sdk/src/provider.tsx +44 -0
- package/template/packages/sdk/src/queryCache.ts +170 -0
- package/template/packages/sdk/src/runtime.ts +451 -0
- package/template/packages/sdk/src/styles.css +213 -0
- package/template/packages/sdk/src/tailwind.ts +56 -0
- package/template/packages/{notis-sdk → sdk}/src/vite.ts +5 -1
- package/template/tailwind.config.ts +1 -0
- package/src/command-specs/db.js +0 -163
- package/src/runtime/app-preview-server.js +0 -312
- package/template/packages/notis-sdk/src/config.ts +0 -48
- package/template/packages/notis-sdk/src/helpers.ts +0 -131
- package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
- package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
- package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
- package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
- package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
- package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
- package/template/packages/notis-sdk/src/index.ts +0 -47
- package/template/packages/notis-sdk/src/provider.tsx +0 -44
- package/template/packages/notis-sdk/src/runtime.ts +0 -159
- package/template/packages/notis-sdk/src/styles.css +0 -123
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/ui.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/tsconfig.json +0 -0
package/src/runtime/output.js
CHANGED
|
@@ -22,6 +22,13 @@ function formatTable(rows, columns) {
|
|
|
22
22
|
return [header, divider, ...body].join('\n');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function formatHint(hint) {
|
|
26
|
+
if (typeof hint?.message === 'string' && hint.message) {
|
|
27
|
+
return ` ${hint.message}`;
|
|
28
|
+
}
|
|
29
|
+
return ` ${hint?.command || ''} ${hint?.reason || ''}`.trimEnd();
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
function yamlScalar(value) {
|
|
26
33
|
if (value === null || value === undefined) {
|
|
27
34
|
return 'null';
|
|
@@ -94,7 +101,30 @@ export class OutputManager {
|
|
|
94
101
|
process.stderr.write(`${message}\n`);
|
|
95
102
|
}
|
|
96
103
|
|
|
104
|
+
note(message) {
|
|
105
|
+
if (this.isMachineMode()) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
process.stderr.write(`${message}\n`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
notice(message) {
|
|
112
|
+
// Some pre-result instructions are required to make progress. They belong
|
|
113
|
+
// on stderr so stdout stays one valid machine envelope, but unlike ordinary
|
|
114
|
+
// table notes they must remain visible in JSON/YAML/NDJSON modes.
|
|
115
|
+
process.stderr.write(`${message}\n`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
emitProgress({ phase, message, requestId = null }) {
|
|
119
|
+
if (this.runtime.quiet) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const suffix = requestId ? ` (${requestId})` : '';
|
|
123
|
+
process.stderr.write(`[${phase}] ${message}${suffix}\n`);
|
|
124
|
+
}
|
|
125
|
+
|
|
97
126
|
emitSuccess({
|
|
127
|
+
ok = true,
|
|
98
128
|
command,
|
|
99
129
|
data = {},
|
|
100
130
|
humanSummary,
|
|
@@ -105,7 +135,7 @@ export class OutputManager {
|
|
|
105
135
|
renderHuman,
|
|
106
136
|
}) {
|
|
107
137
|
const envelope = {
|
|
108
|
-
ok:
|
|
138
|
+
ok: Boolean(ok),
|
|
109
139
|
command,
|
|
110
140
|
data,
|
|
111
141
|
human_summary: humanSummary,
|
|
@@ -115,7 +145,10 @@ export class OutputManager {
|
|
|
115
145
|
meta: {
|
|
116
146
|
profile: this.runtime.profileName,
|
|
117
147
|
api_base: this.runtime.apiBase,
|
|
118
|
-
mutating:
|
|
148
|
+
mutating:
|
|
149
|
+
meta.mutating === true
|
|
150
|
+
? true
|
|
151
|
+
: (meta.mutating === false ? false : null),
|
|
119
152
|
...meta,
|
|
120
153
|
},
|
|
121
154
|
};
|
|
@@ -141,7 +174,7 @@ export class OutputManager {
|
|
|
141
174
|
}
|
|
142
175
|
|
|
143
176
|
if (hints.length) {
|
|
144
|
-
const lines = hints.map(
|
|
177
|
+
const lines = hints.map(formatHint);
|
|
145
178
|
process.stdout.write(`\nNext:\n${lines.join('\n')}\n`);
|
|
146
179
|
}
|
|
147
180
|
|
|
@@ -170,11 +203,10 @@ export class OutputManager {
|
|
|
170
203
|
|
|
171
204
|
process.stderr.write(`Error: ${error.message}\n`);
|
|
172
205
|
for (const hint of error.hints || []) {
|
|
173
|
-
process.stderr.write(
|
|
206
|
+
process.stderr.write(`${formatHint(hint)}\n`);
|
|
174
207
|
}
|
|
175
208
|
return error.exitCode || EXIT_CODES.unexpected;
|
|
176
209
|
}
|
|
177
210
|
}
|
|
178
211
|
|
|
179
212
|
export { formatTable };
|
|
180
|
-
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
|
|
3
|
+
export async function getAvailablePortPreferring(preferredPort) {
|
|
4
|
+
if (Number.isInteger(preferredPort) && preferredPort > 0 && preferredPort <= 65535) {
|
|
5
|
+
const preferredIsFree = await new Promise((resolvePromise) => {
|
|
6
|
+
const server = createServer();
|
|
7
|
+
server.once('error', () => resolvePromise(false));
|
|
8
|
+
server.listen(preferredPort, '127.0.0.1', () => {
|
|
9
|
+
server.close(() => resolvePromise(true));
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
if (preferredIsFree) {
|
|
13
|
+
return preferredPort;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return getAvailablePort();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function getAvailablePort() {
|
|
20
|
+
const server = createServer();
|
|
21
|
+
await new Promise((resolvePromise, rejectPromise) => {
|
|
22
|
+
server.once('error', rejectPromise);
|
|
23
|
+
server.listen(0, '127.0.0.1', () => {
|
|
24
|
+
server.off('error', rejectPromise);
|
|
25
|
+
resolvePromise();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
const { port } = server.address();
|
|
29
|
+
await new Promise((resolvePromise) => server.close(resolvePromise));
|
|
30
|
+
return port;
|
|
31
|
+
}
|