@netscript/plugin@0.0.10Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
The plugin authoring contract for NetScript: a fluent definePlugin builder producing type-safe manifests that host tooling turns into runtime files, services, and Aspire resources.
Classes
Filesystem walker for plugin source discovery.
- walk(root: string): Promise<readonly WalkedFile[]>
Walk source files under a root directory.
In-memory file system adapter for plugin tests.
- exists(path: string): Promise<boolean>
Check whether an in-memory path exists.
- files: Map<string, string>
Mutable in-memory file contents keyed by path.
- readText(path: string): Promise<string>
Read text content from an in-memory path.
- writeText(): Promise<void>path: string,text: string
Write text content to an in-memory path.
In-memory manifest resolver used by tests and alpha SDK stubs.
- resolve(_spec: string): Promise<PluginManifest | undefined>
Resolve a manifest from the in-memory value.
Abstract base class for plugin-owned CLI command groups.
- commands(): readonly PluginCliCommand[]
Return commands exposed by this plugin CLI.
- description: string
Plugin CLI group description.
- name: string
Plugin CLI group name.
Registry emitter that writes one generated TypeScript module per contribution axis.
- emit(contributions: readonly ExtractedContribution[]): Promise<readonly RegistryEmission[]>
Emit generated registry modules for extracted contributions.
Functions
Example plugin manifest fixture.
Example walked file fixture.
Run the shared plugin CLI contract against a CLI instance.
Interfaces
Background processor contributed by a plugin.
- concurrency: number
Optional processor concurrency.
- entrypoint: string
Processor entrypoint path.
- name: string
Logical processor name.
Contract version contributed by a plugin.
Database schema file contributed by a plugin.
End-to-end test contribution.
Port for emitting generated plugin registry files.
- emit(contributions: readonly ExtractedContribution[]): Promise<readonly RegistryEmission[]>
Emit registry files for extracted contributions.
Extracted contribution candidate from source.
Minimal file system port used by plugin scaffolding.
Port for resolving a plugin manifest from a package or module specifier.
- resolve(spec: string): Promise<PluginManifest | undefined>
Resolve a manifest for a package or module specifier.
Data or schema migration contribution.
Command arguments passed to plugin CLI handlers.
A mounted CLI command handler.
- description: string
Short command description for help output.
- name: string
Command name exposed under the plugin CLI.
- run: (args: PluginCliArgs) => PluginCliResult | Promise<PluginCliResult>
Run the command with parsed arguments.
Result returned by plugin CLI handlers.
Context supplied to plugin lifecycle hooks.
- isDev: boolean
Whether the host is running in development mode.
- logger: PluginLogger
Logger supplied by the host.
- manifest: unknown
Parsed plugin manifest.
- pluginRoot: string
Absolute plugin root path when the plugin is local.
- projectRoot: string
Absolute project root path for the host application.
Contribution groups supported by plugin manifests.
- aspire: string
Aspire contribution module reference.
- backgroundProcessors: readonly BackgroundProcessorContribution[]
Background processor contributions registered by the plugin.
- cli: { readonly doctorChecks?: readonly "auth-backend"[]; }
CLI capabilities owned by the plugin and consumed generically by the host.
- contractVersions: readonly ContractVersionContribution[]
Contract version contributions registered by the plugin.
- databaseSchemas: readonly DbSchemaContribution[]
Database schema contributions registered by the plugin.
- doctor: string
Plugin adapter module containing doctor checks.
- e2e: readonly E2eContribution[]
End-to-end test contributions registered by the plugin.
- migrations: readonly MigrationContribution[]
Migration contributions registered by the plugin.
- runtimeConfigTopics: readonly RuntimeConfigTopicContribution[]
Runtime config topic contributions registered by the plugin.
- sdkClients: readonly SdkClientContributionReference[]
Declarative SDK client-contribution factories made available by the plugin.
- services: readonly ServiceContribution[]
Service contributions registered by the plugin.
- streamTopics: readonly StreamTopicContribution[]
Stream topic contributions registered by the plugin.
- telemetry: readonly TelemetryContribution[]
Telemetry contributions registered by the plugin.
Lifecycle hooks supported by plugin definitions.
- afterGenerate: (context: PluginContext) => void | Promise<void>
Hook called after generation tasks complete.
- beforeGenerate: (context: PluginContext) => void | Promise<void>
Hook called before generation tasks run.
- setup: (context: PluginContext) => void | Promise<void>
Hook called when the plugin is initialized.
- teardown: (context: PluginContext) => void | Promise<void>
Hook called when the plugin is torn down.
Logger shape supplied to plugin lifecycle hooks.
- debug: () => voidmessage: string,fields?: Record<string, unknown>
Emit a debug-level lifecycle message.
- error: () => voidmessage: string,fields?: Record<string, unknown>
Emit an error-level lifecycle message.
- info: () => voidmessage: string,fields?: Record<string, unknown>
Emit an info-level lifecycle message.
- warn: () => voidmessage: string,fields?: Record<string, unknown>
Emit a warning-level lifecycle message.
Plugin manifest consumed by NetScript hosts and tooling.
- author: string
Plugin author.
- contributions: PluginContributions
Contribution groups registered by the plugin.
- dependencies: PluginDependencies
Typed plugin dependencies consumed by this plugin.
- description: string
Human-readable plugin description.
- displayName: string
Display name used in UI surfaces.
- hooks: PluginLifecycleHooks
Lifecycle hooks registered by the plugin.
- license: string
Plugin license identifier.
- metadata: PluginMetadata
Runtime-safe metadata.
- name: string
Plugin package name.
- permissions: readonly string[]
Permissions requested by the plugin.
- tags: readonly string[]
Plugin tags for discovery.
- type: PluginType
Plugin category.
- version: string
Plugin semantic version.
Output emitted by the registry emitter.
Runtime config topic contributed by a plugin.
- name: string
Runtime config topic name.
- schemaPath: string
Optional path to the JSON schema for this topic.
Service contributed by a plugin.
- entrypoint: string
Service entrypoint path.
- name: string
Logical service name.
- port: number
Optional service port.
Stream topic contributed by a plugin.
Telemetry instrumentation contribution.
File discovered by a plugin source walker.
Port for discovering plugin source files.
- walk(root: string): Promise<readonly WalkedFile[]>
Walk a root directory and return source files.
Type Aliases
Typed plugin dependency record keyed by caller-chosen aliases.
Metadata attached to plugin manifests.
| number
| boolean
| null
| readonly PluginMetadataValue[]
| { readonly [key: string]: PluginMetadataValue; }
Runtime-safe metadata values.
Supported plugin category value.