@notis_ai/cli 0.2.0-beta.191.1 → 0.2.0-beta.196.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 +479 -80
- package/config/portal-route-roots.json +48 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +29072 -2784
- package/dist/base-skills/notis-apps/SKILL.md +88 -67
- package/dist/base-skills/notis-apps/references/architecture.md +114 -167
- package/dist/base-skills/notis-apps/references/design.md +26 -107
- package/dist/base-skills/notis-apps/references/memory.md +58 -0
- package/dist/base-skills/notis-apps/references/reading.md +52 -74
- package/dist/base-skills/notis-apps/references/release.md +104 -142
- package/dist/base-skills/notis-apps/references/sdk.md +113 -60
- package/dist/base-skills/notis-apps/references/troubleshooting.md +22 -21
- package/dist/base-skills/notis-apps/references/views.md +142 -0
- package/dist/base-skills/notis-cli/SKILL.md +4 -4
- package/dist/base-skills/notis-cli/references/app-delivery.md +12 -11
- package/dist/base-skills/notis-cli/references/native-databases.md +6 -6
- package/dist/base-skills/notis-cli/references/tool-examples.md +4 -4
- package/dist/base-skills/notis-query/SKILL.md +34 -60
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -69
- package/dist/base-skills/notis-query/references/documents.md +63 -50
- package/dist/base-skills/notis-query/references/query.md +57 -524
- package/dist/sdk/src/bundleModule.ts +79 -0
- package/dist/sdk/src/components/DocumentEditor.tsx +6 -3
- package/dist/sdk/src/components/DocumentPage.tsx +141 -0
- package/dist/sdk/src/components/RecordComponents.tsx +33 -0
- package/dist/sdk/src/components/RenderChartData.tsx +19 -0
- package/dist/sdk/src/config.ts +4 -26
- package/dist/sdk/src/documents.ts +2 -0
- package/dist/sdk/src/hooks/useAction.ts +28 -0
- package/dist/sdk/src/hooks/useCloudComputer.ts +35 -4
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
- package/dist/sdk/src/hooks/useHandover.ts +5 -4
- package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
- package/dist/sdk/src/hooks/useNativeDocuments.ts +83 -0
- package/dist/sdk/src/hooks/useNotis.ts +3 -0
- package/dist/sdk/src/hooks/useNotisNavigation.ts +26 -11
- package/dist/sdk/src/hooks/useQuery.ts +7 -4
- package/dist/sdk/src/hooks/useViewParams.ts +121 -0
- package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
- package/dist/sdk/src/index.ts +36 -0
- package/dist/sdk/src/interactions/shortcuts.tsx +17 -3
- package/dist/sdk/src/nativeData.ts +39 -0
- package/dist/sdk/src/presentation.tsx +82 -0
- package/dist/sdk/src/provider.tsx +9 -4
- package/dist/sdk/src/queryCache.ts +5 -3
- package/dist/sdk/src/queryErrors.ts +51 -0
- package/dist/sdk/src/runtime.ts +146 -8
- package/dist/sdk/src/space.ts +425 -0
- package/dist/sdk/src/styles.css +96 -72
- package/dist/sdk/src/vite.ts +11 -1
- package/dist/skill-sync/index.js +458 -68
- package/dist/skill-sync/index.js.map +4 -4
- package/dist/skill-sync-worker.mjs +451 -77
- package/dist/space-harness/host.js +66 -0
- package/dist/view-renderer/dist/host.css +1 -0
- package/dist/view-renderer/dist/host.js +1042 -0
- package/dist/view-renderer/dist/theme.css +73 -0
- package/dist/view-renderer/src/dom.js +180 -0
- package/dist/view-renderer/src/errors.js +8 -0
- package/dist/view-renderer/src/host.tsx +173 -0
- package/dist/view-renderer/src/index.js +4 -0
- package/dist/view-renderer/src/pool.js +76 -0
- package/dist/view-renderer/src/remote-broker.js +59 -0
- package/dist/view-renderer/src/renderer.js +201 -0
- package/package.json +11 -5
- package/skills/notis-apps/cli.md +270 -163
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
- package/skills/notis-onboarding/BRIEF.md +7 -3
- package/src/command-specs/apps.js +1 -8
- package/src/command-specs/files.js +29 -0
- package/src/command-specs/helpers.js +1 -0
- package/src/command-specs/index.js +10 -4
- package/src/command-specs/skills.js +229 -0
- package/src/command-specs/spaces.js +572 -0
- package/src/command-specs/views.js +69 -0
- package/src/runtime/agent-browser.js +30 -7
- package/src/runtime/app-boundary-validator.js +7 -4
- package/src/runtime/app-data-literals.js +82 -0
- package/src/runtime/app-platform.js +321 -253
- package/src/runtime/confined-space-build.js +74 -0
- package/src/runtime/confined-space-verify.js +49 -0
- package/src/runtime/native-record-files.js +47 -0
- package/src/runtime/retired-sdk-files.js +20 -0
- package/src/runtime/skill-sync/cloud-client.ts +26 -4
- package/src/runtime/skill-sync/index.ts +154 -35
- package/src/runtime/skill-sync/local-scanner.ts +125 -17
- package/src/runtime/skill-sync/native-identity.ts +102 -0
- package/src/runtime/skill-sync/native-plan.ts +59 -0
- package/src/runtime/skill-sync/sync-plan.ts +16 -9
- package/src/runtime/skill-sync/types.ts +32 -6
- package/src/runtime/source-root.js +32 -0
- package/src/runtime/space-collection-scaffold.js +66 -0
- package/src/runtime/space-database-structures.js +229 -0
- package/src/runtime/space-fixture-broker.js +50 -0
- package/src/runtime/space-lock.js +337 -0
- package/src/runtime/space-platform.js +105 -0
- package/src/runtime/space-source.js +281 -0
- package/src/runtime/space-test-server.js +327 -0
- package/src/runtime/space-verification.js +89 -0
- package/src/runtime/space-verify-browser-worker.js +51 -0
- package/src/runtime/space-view-manifest.js +254 -0
- package/src/runtime/sync-skills.js +1 -1
- package/src/runtime/transport.js +8 -1
- package/src/runtime/view-render.js +49 -0
- package/src/space-harness-host.ts +103 -0
- package/template/app/globals.css +1 -0
- package/src/command-specs/reports.js +0 -97
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, rmSync } from 'node:fs';
|
|
2
|
-
import { resolve, join } from 'node:path';
|
|
3
|
-
import { appsCommandSpecs, appsInitHandler, appsBuildHandler, appsVerifyHandler } from './apps.js';
|
|
4
|
-
import { buildArtifact, prepareAppRelease, resolveProjectDir, loadAppConfig } from '../runtime/app-platform.js';
|
|
5
|
-
import { nextIdempotencyKey, runToolCommand } from './helpers.js';
|
|
6
|
-
import { usageError, EXIT_CODES } from '../runtime/errors.js';
|
|
7
|
-
|
|
8
|
-
async function assertReportProject(ctx) {
|
|
9
|
-
const dir = resolveProjectDir(ctx.args.dir || '.');
|
|
10
|
-
if ((await loadAppConfig(dir)).kind !== 'report') throw usageError('Set kind: "report" in notis.config.ts. Reports have no app installation or owned resources.');
|
|
11
|
-
return dir;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async function initReport(ctx) {
|
|
15
|
-
const dir = resolveProjectDir(ctx.args.dir || `./${ctx.args.name.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`);
|
|
16
|
-
const result = await appsInitHandler({ ...ctx, args: { ...ctx.args, dir }, options: {}, output: { emitSuccess: value => value } });
|
|
17
|
-
writeFileSync(join(dir, 'notis.config.ts'), `import { defineNotisApp } from '@notis/sdk/config';
|
|
18
|
-
export default defineNotisApp({
|
|
19
|
-
kind: 'report', name: ${JSON.stringify(ctx.args.name)},
|
|
20
|
-
routes: [{ path: '/', slug: 'home', name: 'Report', default: true }],
|
|
21
|
-
tools: [],
|
|
22
|
-
});
|
|
23
|
-
`);
|
|
24
|
-
writeFileSync(join(dir, 'app/page.tsx'), `'use client';
|
|
25
|
-
import { useNotis, NotisCommentBoundary } from '@notis/sdk';
|
|
26
|
-
export default function Report() {
|
|
27
|
-
const { app } = useNotis();
|
|
28
|
-
return <NotisCommentBoundary><main className="notis-app-shell space-y-6">
|
|
29
|
-
<h1 className="text-2xl font-semibold">{app?.name || 'Report'}</h1>
|
|
30
|
-
<p className="text-muted-foreground">Your report is ready to build.</p>
|
|
31
|
-
</main></NotisCommentBoundary>;
|
|
32
|
-
}
|
|
33
|
-
`);
|
|
34
|
-
rmSync(join(dir, 'CHANGELOG.md'), { force: true });
|
|
35
|
-
return ctx.output.emitSuccess({ ...result, command: 'reports init', hints: [
|
|
36
|
-
{ command: `cd ${dir} && npm install`, reason: 'Install dependencies' },
|
|
37
|
-
{ command: `notis reports build ${dir}`, reason: 'Build the standalone report' },
|
|
38
|
-
] });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const localReportCommand = (command, name = command) => {
|
|
42
|
-
const app = appsCommandSpecs.find(item => item.command_path.join(' ') === `apps ${command}`);
|
|
43
|
-
return { ...app, command_path: ['reports', name],
|
|
44
|
-
summary: `${name[0].toUpperCase() + name.slice(1)} a standalone live SDK report.`,
|
|
45
|
-
when_to_use: 'Author a private standalone document using the shared view runtime; no app or database is required.',
|
|
46
|
-
args_schema: { ...app.args_schema, options: [...(app.args_schema.options || []).filter(option => !['--listing', '--from <slug>'].includes(option.flags)), ...(command === 'verify' ? [{ flags: '--document-id <id>', description: 'Saved report for live verification.' }, { flags: '--expected-revision <revision>', description: 'Saved report revision for live verification.' }] : [])] },
|
|
47
|
-
examples: [`notis reports ${name} ${command === 'init' ? '"Weekly report" ./weekly-report' : './weekly-report'}`],
|
|
48
|
-
handler: async ctx => {
|
|
49
|
-
if (command === 'init') return initReport(ctx);
|
|
50
|
-
await assertReportProject(ctx);
|
|
51
|
-
return (command === 'build' ? appsBuildHandler : appsVerifyHandler)({ ...ctx, options: { ...ctx.options, ...(name === 'preview' ? { keepOpen: true } : {}) } });
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export const reportsCommandSpecs = [
|
|
56
|
-
localReportCommand('init'), localReportCommand('build'), localReportCommand('verify'), localReportCommand('verify', 'preview'),
|
|
57
|
-
{
|
|
58
|
-
command_path: ['reports', 'save'],
|
|
59
|
-
summary: 'Build, verify and save a standalone live report document.',
|
|
60
|
-
when_to_use: 'Persist an independently owned report, not an app release.',
|
|
61
|
-
args_schema: {
|
|
62
|
-
arguments: [{ token: '[dir]', key: 'dir', description: 'Report source directory.' }],
|
|
63
|
-
options: [
|
|
64
|
-
{ flags: '--document-id <id>', description: 'Existing report document to update.' },
|
|
65
|
-
{ flags: '--expected-revision <revision>', description: 'Current saved report revision; required for updates.' },
|
|
66
|
-
{ flags: '--title <title>', description: 'Required, including updates. Document title.' },
|
|
67
|
-
{ flags: '--context-file <file>', description: 'Required. UTF-8 readable report content and structure.' },
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
examples: ['notis reports save ./weekly-report --title \"Weekly review\" --context-file ./context.md'], mutates: true, idempotent: true,
|
|
71
|
-
backend_call: { type: 'tool', name: 'LOCAL_NOTIS_SAVE_REPORT' },
|
|
72
|
-
async handler(ctx) {
|
|
73
|
-
const dir = await assertReportProject(ctx);
|
|
74
|
-
if (!ctx.options.title || !ctx.options.contextFile) throw usageError('--title and --context-file are required.');
|
|
75
|
-
if (ctx.options.documentId && (!/^\d+$/.test(String(ctx.options.expectedRevision ?? '')) || !Number.isSafeInteger(Number(ctx.options.expectedRevision)))) throw usageError('--expected-revision is required for update.');
|
|
76
|
-
const context = readFileSync(resolve(ctx.options.contextFile), 'utf8');
|
|
77
|
-
await buildArtifact(dir, { stdio: ctx.output.isMachineMode() ? 'pipe' : 'inherit' });
|
|
78
|
-
const release = prepareAppRelease(dir);
|
|
79
|
-
try {
|
|
80
|
-
if (release.manifest.routes?.length !== 1) throw usageError('Reports require exactly one SDK route.');
|
|
81
|
-
let verification;
|
|
82
|
-
const exit = await appsVerifyHandler({ ...ctx, args: { dir: release.projectDir }, options: { skipBuild: true, mode: 'stub' }, output: { ...ctx.output, isMachineMode: () => true, emitSuccess: value => { verification = value; } } });
|
|
83
|
-
if (exit !== EXIT_CODES.ok || verification?.data?.status !== 'passed') throw usageError('Report verification failed; nothing saved.');
|
|
84
|
-
const files = { ...release.files, ...Object.fromEntries(Object.entries(release.sourceFiles).map(([path, data]) => [`source/${path}`, data])) };
|
|
85
|
-
const result = await runToolCommand({ runtime: { ...ctx.runtime, timeoutMs: Math.max(ctx.runtime.timeoutMs || 0, 90000) }, toolName: 'LOCAL_NOTIS_SAVE_REPORT', mutating: true,
|
|
86
|
-
idempotencyKey: nextIdempotencyKey(ctx.globalOptions), arguments_: {
|
|
87
|
-
operation: ctx.options.documentId ? 'update' : 'create',
|
|
88
|
-
title: ctx.options.title,
|
|
89
|
-
...(ctx.options.documentId ? { document_id: ctx.options.documentId, expected_revision: Number(ctx.options.expectedRevision) } : {}),
|
|
90
|
-
report: { schema: 'notis-report/v3', context, artifact: { manifest: release.manifest, files, encoding: 'base64' } },
|
|
91
|
-
} });
|
|
92
|
-
if (!result?.payload?.document?.id || !result.payload.document.view_revision) throw usageError('Save returned no record identity. Read back before retrying; the outcome may be unknown.');
|
|
93
|
-
return ctx.output.emitSuccess({ command: 'reports save', data: result.payload });
|
|
94
|
-
} finally { release.close(); }
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
];
|