@nseng-ai/ns 0.1.1 → 0.1.2
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 +4 -12
- package/bin/ns.js +8178 -4199
- package/kernel/cli.js +1885 -259
- package/kernel/command-io.js +12 -1
- package/kernel/context.js +17 -1
- package/kernel/sdk.js +12 -1
- package/package.json +1 -1
package/kernel/command-io.js
CHANGED
|
@@ -14,6 +14,8 @@ function optionalEntry(key, value) {
|
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
16
|
// ../../kernel/src/sdk/extension-manifest.ts
|
|
17
|
+
var nsExtensionPointAcceptsValues = ["hook", "prompt"];
|
|
18
|
+
var nsExtensionPointSemanticsValues = ["additive", "override"];
|
|
17
19
|
var nsExtensionManifestCommandSchema = z.looseObject({
|
|
18
20
|
name: z.string().optional(),
|
|
19
21
|
path: z.array(z.string()).optional(),
|
|
@@ -22,10 +24,18 @@ var nsExtensionManifestCommandSchema = z.looseObject({
|
|
|
22
24
|
fullDescription: z.string().optional(),
|
|
23
25
|
entry: z.string().optional()
|
|
24
26
|
});
|
|
27
|
+
var nsExtensionManifestPointSchema = z.looseObject({
|
|
28
|
+
path: z.array(z.string()).optional(),
|
|
29
|
+
accepts: z.enum(nsExtensionPointAcceptsValues).optional(),
|
|
30
|
+
semantics: z.enum(nsExtensionPointSemanticsValues).optional(),
|
|
31
|
+
default: z.string().optional(),
|
|
32
|
+
description: z.string().optional()
|
|
33
|
+
});
|
|
25
34
|
var nsExtensionManifestSchema = z.looseObject({
|
|
26
35
|
description: z.string().optional(),
|
|
27
36
|
group: z.string().optional(),
|
|
28
|
-
commands: z.array(z.unknown()).optional()
|
|
37
|
+
commands: z.array(z.unknown()).optional(),
|
|
38
|
+
points: z.array(z.unknown()).optional()
|
|
29
39
|
});
|
|
30
40
|
var nsExtensionPackageManifestSchema = z.looseObject({
|
|
31
41
|
description: z.string().optional(),
|
|
@@ -44,6 +54,7 @@ var noopNsCommandIo = {
|
|
|
44
54
|
}
|
|
45
55
|
};
|
|
46
56
|
var noopNsProgress = {
|
|
57
|
+
isLive: false,
|
|
47
58
|
phase: () => {
|
|
48
59
|
}
|
|
49
60
|
};
|
package/kernel/context.js
CHANGED
|
@@ -3639,6 +3639,9 @@ function optionalEntry(key, value) {
|
|
|
3639
3639
|
function formatErrorMessage(error) {
|
|
3640
3640
|
return error instanceof Error ? error.message : String(error);
|
|
3641
3641
|
}
|
|
3642
|
+
function resolveHomeDir(explicit, env) {
|
|
3643
|
+
return explicit ?? env.HOME;
|
|
3644
|
+
}
|
|
3642
3645
|
|
|
3643
3646
|
// ../../infra/foundation/src/cli-runtime/stdin.ts
|
|
3644
3647
|
import process2 from "node:process";
|
|
@@ -3786,6 +3789,8 @@ async function runCommand(command, args, options = {}) {
|
|
|
3786
3789
|
import { z as z6 } from "zod";
|
|
3787
3790
|
|
|
3788
3791
|
// ../../kernel/src/sdk/extension-manifest.ts
|
|
3792
|
+
var nsExtensionPointAcceptsValues = ["hook", "prompt"];
|
|
3793
|
+
var nsExtensionPointSemanticsValues = ["additive", "override"];
|
|
3789
3794
|
var nsExtensionManifestCommandSchema = z6.looseObject({
|
|
3790
3795
|
name: z6.string().optional(),
|
|
3791
3796
|
path: z6.array(z6.string()).optional(),
|
|
@@ -3794,10 +3799,18 @@ var nsExtensionManifestCommandSchema = z6.looseObject({
|
|
|
3794
3799
|
fullDescription: z6.string().optional(),
|
|
3795
3800
|
entry: z6.string().optional()
|
|
3796
3801
|
});
|
|
3802
|
+
var nsExtensionManifestPointSchema = z6.looseObject({
|
|
3803
|
+
path: z6.array(z6.string()).optional(),
|
|
3804
|
+
accepts: z6.enum(nsExtensionPointAcceptsValues).optional(),
|
|
3805
|
+
semantics: z6.enum(nsExtensionPointSemanticsValues).optional(),
|
|
3806
|
+
default: z6.string().optional(),
|
|
3807
|
+
description: z6.string().optional()
|
|
3808
|
+
});
|
|
3797
3809
|
var nsExtensionManifestSchema = z6.looseObject({
|
|
3798
3810
|
description: z6.string().optional(),
|
|
3799
3811
|
group: z6.string().optional(),
|
|
3800
|
-
commands: z6.array(z6.unknown()).optional()
|
|
3812
|
+
commands: z6.array(z6.unknown()).optional(),
|
|
3813
|
+
points: z6.array(z6.unknown()).optional()
|
|
3801
3814
|
});
|
|
3802
3815
|
var nsExtensionPackageManifestSchema = z6.looseObject({
|
|
3803
3816
|
description: z6.string().optional(),
|
|
@@ -3806,6 +3819,7 @@ var nsExtensionPackageManifestSchema = z6.looseObject({
|
|
|
3806
3819
|
|
|
3807
3820
|
// ../../kernel/src/sdk/services.ts
|
|
3808
3821
|
var noopNsProgress = {
|
|
3822
|
+
isLive: false,
|
|
3809
3823
|
phase: () => {
|
|
3810
3824
|
}
|
|
3811
3825
|
};
|
|
@@ -3996,6 +4010,7 @@ function createTextGenerator() {
|
|
|
3996
4010
|
function createRealNsCommandContext(options = {}) {
|
|
3997
4011
|
const cwd = options.cwd ?? process3.cwd();
|
|
3998
4012
|
const env = options.env ?? process3.env;
|
|
4013
|
+
const homeDir = resolveHomeDir(options.homeDir, env);
|
|
3999
4014
|
const textGenerator = createTextGenerator();
|
|
4000
4015
|
const confirm = createTerminalConfirmPrompt();
|
|
4001
4016
|
const stdout = (text) => process3.stdout.write(text);
|
|
@@ -4004,6 +4019,7 @@ function createRealNsCommandContext(options = {}) {
|
|
|
4004
4019
|
return {
|
|
4005
4020
|
cwd,
|
|
4006
4021
|
env,
|
|
4022
|
+
...optionalEntry("homeDir", homeDir),
|
|
4007
4023
|
textGenerator,
|
|
4008
4024
|
commandIo,
|
|
4009
4025
|
progress: noopNsProgress,
|
package/kernel/sdk.js
CHANGED
|
@@ -24,6 +24,8 @@ function defineRepoLocalNsExtensionDescriptor(descriptor) {
|
|
|
24
24
|
import { z } from "zod";
|
|
25
25
|
|
|
26
26
|
// ../../kernel/src/sdk/extension-manifest.ts
|
|
27
|
+
var nsExtensionPointAcceptsValues = ["hook", "prompt"];
|
|
28
|
+
var nsExtensionPointSemanticsValues = ["additive", "override"];
|
|
27
29
|
var nsExtensionManifestCommandSchema = z.looseObject({
|
|
28
30
|
name: z.string().optional(),
|
|
29
31
|
path: z.array(z.string()).optional(),
|
|
@@ -32,10 +34,18 @@ var nsExtensionManifestCommandSchema = z.looseObject({
|
|
|
32
34
|
fullDescription: z.string().optional(),
|
|
33
35
|
entry: z.string().optional()
|
|
34
36
|
});
|
|
37
|
+
var nsExtensionManifestPointSchema = z.looseObject({
|
|
38
|
+
path: z.array(z.string()).optional(),
|
|
39
|
+
accepts: z.enum(nsExtensionPointAcceptsValues).optional(),
|
|
40
|
+
semantics: z.enum(nsExtensionPointSemanticsValues).optional(),
|
|
41
|
+
default: z.string().optional(),
|
|
42
|
+
description: z.string().optional()
|
|
43
|
+
});
|
|
35
44
|
var nsExtensionManifestSchema = z.looseObject({
|
|
36
45
|
description: z.string().optional(),
|
|
37
46
|
group: z.string().optional(),
|
|
38
|
-
commands: z.array(z.unknown()).optional()
|
|
47
|
+
commands: z.array(z.unknown()).optional(),
|
|
48
|
+
points: z.array(z.unknown()).optional()
|
|
39
49
|
});
|
|
40
50
|
var nsExtensionPackageManifestSchema = z.looseObject({
|
|
41
51
|
description: z.string().optional(),
|
|
@@ -134,6 +144,7 @@ var noopNsCommandIo = {
|
|
|
134
144
|
}
|
|
135
145
|
};
|
|
136
146
|
var noopNsProgress = {
|
|
147
|
+
isLive: false,
|
|
137
148
|
phase: () => {
|
|
138
149
|
}
|
|
139
150
|
};
|