@punica/editor 1.0.6 → 1.0.7

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.
Files changed (69) hide show
  1. package/dist/index.bundle.esm.js +1 -1
  2. package/dist/index.bundle.esm.js.map +1 -1
  3. package/dist/index.bundle.umd.js +1 -1
  4. package/dist/index.bundle.umd.js.map +1 -1
  5. package/package.json +28 -3
  6. package/types/index.d.ts +120 -11
  7. package/types/punica.module.bootstrap.d.ts +45 -0
  8. package/types/punica.module.capability.d.ts +359 -0
  9. package/types/punica.module.extensions.api.d.ts +740 -0
  10. package/types/punica.module.extensions.settings.d.ts +106 -0
  11. package/types/punica.module.flow.agent.d.ts +75 -0
  12. package/types/punica.module.flow.api.d.ts +128 -0
  13. package/types/punica.module.flow.d.ts +490 -0
  14. package/types/punica.module.flow.engine.d.ts +228 -0
  15. package/types/punica.module.flow.mcp.d.ts +26 -0
  16. package/types/punica.module.flow.notebook.d.ts +210 -0
  17. package/types/punica.module.flow.primitives.d.ts +700 -0
  18. package/types/punica.module.flow.shell.d.ts +374 -0
  19. package/types/punica.module.kernel.ai.d.ts +462 -0
  20. package/types/punica.module.kernel.commands.d.ts +49 -0
  21. package/types/punica.module.kernel.events.d.ts +274 -0
  22. package/types/punica.module.kernel.history.d.ts +20 -0
  23. package/types/punica.module.kernel.llm.d.ts +343 -0
  24. package/types/punica.module.kernel.notifications.d.ts +64 -0
  25. package/types/punica.module.kernel.policy.d.ts +273 -0
  26. package/types/punica.module.kernel.tasks.d.ts +107 -0
  27. package/types/punica.module.kernel.timeServer.d.ts +16 -0
  28. package/types/punica.module.runtime.api.d.ts +214 -0
  29. package/types/punica.module.runtime.capabilities.d.ts +175 -0
  30. package/types/punica.module.runtime.compute.d.ts +339 -0
  31. package/types/punica.module.runtime.datasets.d.ts +234 -0
  32. package/types/punica.module.runtime.fs.d.ts +385 -0
  33. package/types/punica.module.runtime.harness.d.ts +246 -0
  34. package/types/punica.module.runtime.host.d.ts +272 -0
  35. package/types/punica.module.runtime.inference.d.ts +164 -0
  36. package/types/punica.module.runtime.lifecycle.d.ts +15 -0
  37. package/types/punica.module.runtime.llm.d.ts +470 -0
  38. package/types/punica.module.runtime.mcp.d.ts +139 -0
  39. package/types/punica.module.runtime.modelRuntimes.d.ts +90 -0
  40. package/types/punica.module.runtime.models.d.ts +254 -0
  41. package/types/punica.module.runtime.search.d.ts +59 -0
  42. package/types/punica.module.runtime.secrets.d.ts +26 -0
  43. package/types/punica.module.runtime.tasks.d.ts +27 -0
  44. package/types/punica.module.runtime.vcs.d.ts +67 -0
  45. package/types/punica.module.runtime.vectors.d.ts +74 -0
  46. package/types/punica.module.runtime.workspace.d.ts +134 -0
  47. package/types/punica.module.shell.activityBar.d.ts +42 -0
  48. package/types/punica.module.shell.components.d.ts +87 -0
  49. package/types/punica.module.shell.contentTabs.d.ts +33 -0
  50. package/types/punica.module.shell.dragDrop.d.ts +25 -0
  51. package/types/punica.module.shell.keyboardShortcuts.d.ts +38 -0
  52. package/types/punica.module.shell.layout.d.ts +106 -0
  53. package/types/punica.module.shell.markdown.d.ts +36 -0
  54. package/types/punica.module.shell.panelTabs.d.ts +48 -0
  55. package/types/punica.module.shell.profile.d.ts +278 -0
  56. package/types/punica.module.shell.statusbar.d.ts +26 -0
  57. package/types/punica.module.shell.view.d.ts +455 -0
  58. package/types/punica.module.shell.views.d.ts +150 -0
  59. package/types/punica.module.test.d.ts +562 -0
  60. package/types/punica.module.activityBar.d.ts +0 -21
  61. package/types/punica.module.commands.d.ts +0 -21
  62. package/types/punica.module.dragDrop.d.ts +0 -23
  63. package/types/punica.module.extensions.d.ts +0 -157
  64. package/types/punica.module.history.d.ts +0 -18
  65. package/types/punica.module.keyboardShortcuts.d.ts +0 -29
  66. package/types/punica.module.layout.d.ts +0 -22
  67. package/types/punica.module.statusbar.d.ts +0 -21
  68. package/types/punica.module.timeServer.d.ts +0 -14
  69. package/types/punica.module.view.d.ts +0 -8
@@ -0,0 +1,106 @@
1
+ declare module 'punica' {
2
+ export namespace extensions {
3
+ /**
4
+ * Settings API for managing extension and system settings
5
+ */
6
+ export namespace settings {
7
+ export interface SettingsApi {
8
+ /**
9
+ * Load settings from storage (called automatically, but can be called manually)
10
+ */
11
+ load(): Promise<void>;
12
+
13
+ /**
14
+ * Get setting value for extension
15
+ * Priority: Project > Global > Default
16
+ */
17
+ get(extensionName: string, key: string): unknown;
18
+
19
+ /**
20
+ * Set setting value for extension
21
+ * @param scope 'global' for app-level settings, 'project' for workspace-level (default)
22
+ */
23
+ set(
24
+ extensionName: string,
25
+ key: string,
26
+ value: unknown,
27
+ scope?: 'global' | 'project'
28
+ ): Promise<void>;
29
+
30
+ /**
31
+ * Get all settings for extension
32
+ * Merged from: Default < Global < Project (priority order)
33
+ */
34
+ getAll(extensionName: string): Record<string, unknown>;
35
+
36
+ /**
37
+ * Subscribe to settings changes
38
+ */
39
+ onDidChange(
40
+ extensionName: string,
41
+ callback: (key: string, newValue: unknown, oldValue: unknown) => void
42
+ ): () => void;
43
+
44
+ /**
45
+ * Validate setting value against schema
46
+ */
47
+ validate(
48
+ extensionName: string,
49
+ key: string,
50
+ value: unknown
51
+ ): { ok: boolean; errors?: string[] };
52
+
53
+ /**
54
+ * Get setting with type safety
55
+ */
56
+ getTyped<T>(
57
+ extensionName: string,
58
+ key: string,
59
+ type: 'boolean' | 'string' | 'number'
60
+ ): T | undefined;
61
+
62
+ /**
63
+ * Reset setting to default value from config.yaml
64
+ */
65
+ reset(extensionName: string, key: string): Promise<void>;
66
+
67
+ /**
68
+ * Reset all settings for an extension to defaults
69
+ */
70
+ resetExtension(extensionName: string): Promise<void>;
71
+
72
+ /**
73
+ * Get settings scope (where a setting is currently defined)
74
+ */
75
+ getScope(
76
+ extensionName: string,
77
+ key: string
78
+ ): 'project' | 'global' | 'default';
79
+
80
+ /**
81
+ * Export settings to JSON
82
+ */
83
+ export(options?: {
84
+ includeSystem?: boolean;
85
+ extensions?: string[];
86
+ }): Promise<string>;
87
+
88
+ /**
89
+ * Import settings from JSON
90
+ */
91
+ import(
92
+ json: string,
93
+ options?: {
94
+ merge?: boolean;
95
+ extensions?: string[];
96
+ }
97
+ ): Promise<void>;
98
+ }
99
+
100
+ /**
101
+ * Settings manager façade surfaced via `punica.extensions.settings.manager`.
102
+ */
103
+ export const manager: SettingsApi;
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,75 @@
1
+ /// <reference path="punica.module.flow.d.ts" />
2
+ /// <reference path="punica.module.test.d.ts" />
3
+
4
+ declare module 'punica' {
5
+ /**
6
+ * Agent-level metadata built on top of ivyNode / flow graphs.
7
+ */
8
+ export interface IvyAgentMetadata {
9
+ id: string;
10
+ name: string;
11
+ version?: string;
12
+ description?: string;
13
+ /** Optional scheduling / trigger information (domain-specific). */
14
+ triggers?: JSONObject;
15
+ /** Optional configuration specific to the agent runtime. */
16
+ config?: JSONObject;
17
+ }
18
+
19
+ export namespace flow {
20
+ /**
21
+ * An ivy.agent document — a capability-fronted flow graph. Layouts on
22
+ * disk: canonical nested `.punica/ivy-agents/<id>/ivy.agent.json` and
23
+ * legacy flat `<id>.ivy.agent`.
24
+ */
25
+ export interface AgentDocument {
26
+ apiVersion?: string;
27
+ kind: 'IvyAgent';
28
+ capability: CapabilityDefinition;
29
+ graph: Graph;
30
+ tests?: TestSpec;
31
+ /** Generation pipeline red-stamp: 'failing' | 'untested'. */
32
+ status?: string;
33
+ }
34
+
35
+ /** A discovered agent package (registry entry). */
36
+ export interface AgentPackage {
37
+ /** Package root directory (relative to workspace root). */
38
+ packageRoot: string;
39
+ /** Manifest file path (relative to workspace root). */
40
+ manifestPath: string;
41
+ manifest: AgentDocument;
42
+ }
43
+
44
+ /**
45
+ * `punica.flow.agents` — the agent counterpart of `flow.registry` +
46
+ * `flow.runner`: ID-addressable discovery over `.punica/ivy-agents`
47
+ * plus real execution through the flow engine.
48
+ */
49
+ export interface AgentRegistryApi {
50
+ /** Rescan the workspace and rebuild the agent index. */
51
+ discover(): Promise<void>;
52
+ get(id: CapabilityId): AgentPackage | undefined;
53
+ list(): AgentPackage[];
54
+ search(options: { tags?: string[]; text?: string }): AgentPackage[];
55
+ unregister(id: CapabilityId): boolean;
56
+ /**
57
+ * Run a registered agent through the flow engine and return its
58
+ * `flow-output` value. Throws on unknown id, timeout, approval gate
59
+ * and failed runs — never hangs silently.
60
+ */
61
+ run(
62
+ id: CapabilityId,
63
+ options?: {
64
+ input?: JSONValue;
65
+ timeoutMs?: number;
66
+ workspaceId?: string;
67
+ }
68
+ ): Promise<{ output?: JSONValue; runId: string; durationMs: number }>;
69
+ /** Wrap an agent document in a transient FlowBook envelope. */
70
+ envelope(manifest: unknown): unknown;
71
+ /** True when the value looks like a runnable IvyAgent manifest. */
72
+ isAgentManifest(manifest: unknown): boolean;
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,128 @@
1
+ /// <reference path="punica.module.flow.d.ts" />
2
+ /// <reference path="punica.module.flow.agent.d.ts" />
3
+ /// <reference path="punica.module.test.d.ts" />
4
+
5
+ declare module 'punica' {
6
+ export namespace flow {
7
+ // Note: Types like ValidationResult, NodePackage, RegistrySearchOptions,
8
+ // RunOptions, and RunResult are exported from the implementation files
9
+ // and re-exported from src/impl/ivyNode/index.ts, so they're available
10
+ // when importing from 'punica' module.
11
+
12
+ /**
13
+ * Test Specification Registry API
14
+ */
15
+ export interface TestSpecificationRegistry {
16
+ /**
17
+ * Register a test specification
18
+ */
19
+ register(spec: TestSpecification): void;
20
+
21
+ /**
22
+ * Get test specifications for a capability
23
+ */
24
+ getForCapability(capabilityId: CapabilityId): TestSpecification[];
25
+
26
+ /**
27
+ * Get test specification by ID
28
+ */
29
+ get(testSpecId: TestSpecificationId): TestSpecification | undefined;
30
+
31
+ /**
32
+ * List all test specifications
33
+ */
34
+ list(): TestSpecification[];
35
+
36
+ /**
37
+ * Search test specifications
38
+ */
39
+ search(options: {
40
+ targetCapabilityId?: CapabilityId;
41
+ tier?: 'draft' | 'verified' | 'certified';
42
+ tags?: string[];
43
+ }): TestSpecification[];
44
+
45
+ /**
46
+ * Remove a test specification
47
+ */
48
+ remove(testSpecId: TestSpecificationId): boolean;
49
+ }
50
+
51
+ /**
52
+ * Test Runner API
53
+ */
54
+ export interface TestRunnerApi {
55
+ /**
56
+ * Run test specification
57
+ */
58
+ run(testSpecId: TestSpecificationId): Promise<TestReport>;
59
+
60
+ /**
61
+ * Run test case
62
+ */
63
+ runCase(
64
+ testSpecId: TestSpecificationId,
65
+ caseId: string
66
+ ): Promise<TestCaseResult>;
67
+
68
+ /**
69
+ * Run all test specifications for a capability
70
+ */
71
+ runForCapability(capabilityId: CapabilityId): Promise<TestReport[]>;
72
+ }
73
+
74
+ /**
75
+ * Test Specification API
76
+ */
77
+ export interface TestSpecificationApi {
78
+ registry: TestSpecificationRegistry;
79
+ runner: TestRunnerApi;
80
+ }
81
+
82
+ export interface ValidatorApi {
83
+ validate(manifest: unknown): any; // ValidationResult from manifest/validator
84
+ }
85
+
86
+ export interface RegistryApi {
87
+ discover(): Promise<void>;
88
+ get(id: CapabilityId): any; // NodePackage | undefined
89
+ list(): any[]; // NodePackage[]
90
+ search(options: any): any[]; // RegistrySearchOptions -> NodePackage[]
91
+ setTestReport(capabilityId: CapabilityId, report: TestReport): void;
92
+ getLatestTestReport(capabilityId: CapabilityId): TestReport | undefined;
93
+ }
94
+
95
+ export interface RunnerApi {
96
+ run(nodeId: CapabilityId, options: any): Promise<any>; // RunOptions -> RunResult
97
+ }
98
+
99
+ export interface TestApi {
100
+ /**
101
+ * Run a capability's tests — the single kind-dispatched test surface.
102
+ * A node-registry hit executes the IvyNode path; a miss with an
103
+ * IvyAgent manifest in `options.manifest` executes the agent for real
104
+ * through the flow engine (per-case timeout; approval-gated and failed
105
+ * runs read as graded errors, never silent hangs). A miss without a
106
+ * manifest throws `IvyNode not found`.
107
+ */
108
+ run(
109
+ nodeId: CapabilityId,
110
+ options?: { manifest?: unknown }
111
+ ): Promise<TestReport>;
112
+ }
113
+
114
+ export interface FlowApi {
115
+ validator: ValidatorApi;
116
+ registry: RegistryApi;
117
+ /** IvyAgent registry + runner (`punica.flow.agents`). */
118
+ agents: AgentRegistryApi;
119
+ runner: RunnerApi;
120
+ test: TestApi;
121
+ testSpecification: TestSpecificationApi;
122
+ }
123
+ }
124
+
125
+ // Module-level exports
126
+ export type TestReport = flow.TestReport;
127
+ export type TestCaseResult = flow.TestCaseResult;
128
+ }