{"version":3,"file":"proto-urD3-YE8.mjs","names":["contract"],"sources":["../../contract/plugin.proto","../src/core/transport/proto.ts"],"sourcesContent":["\"// np-agent-v1, the agent's plugin protocol: copied from controlplane-agent\\n// supervisor/proto/pluginpb/plugin.proto at commit\\n// bb59b71250228998f4f850eca0d84f3d0cdcbe17. The agent owns it: a change is made\\n// there first, then copied here with its commit. Only go_package differs, so\\n// the Go implementation generates its own package from this copy.\\n\\nsyntax = \\\"proto3\\\";\\n\\npackage npagent.plugin.v1;\\n\\noption go_package = \\\"github.com/nullplatform/plugin-libraries/contract/pluginpb\\\";\\n\\nimport \\\"google/protobuf/empty.proto\\\";\\n\\n// ExecutorPlugin handles command execution\\nservice ExecutorPlugin {\\n  rpc Execute(ExecuteRequest) returns (stream ExecuteEvent);\\n  rpc Capabilities(google.protobuf.Empty) returns (CapabilitiesResponse);\\n  rpc Health(google.protobuf.Empty) returns (HealthResponse);\\n  rpc Version(google.protobuf.Empty) returns (VersionResponse);\\n}\\n\\n// --- ExecuteRequest ---\\n\\nmessage ExecuteRequest {\\n  string message_id = 1;\\n  string command_type = 2;\\n  bytes payload = 3;\\n  bool supports_partial = 4;\\n  bool can_cancel = 5;\\n  string reply_to = 6;\\n  string action_type = 7;\\n}\\n\\n// --- ExecuteEvent lifecycle: Started → Output* → Result ---\\n\\nmessage ExecuteEvent {\\n  oneof event {\\n    ExecuteStarted started = 1;\\n    ExecuteOutput output = 2;\\n    ExecuteResult result = 3;\\n  }\\n}\\n\\nmessage ExecuteStarted {}\\n\\nmessage ExecuteOutput {\\n  string stdout = 1;\\n  string stderr = 2;\\n  bytes data = 3;\\n}\\n\\nmessage ExecuteResult {\\n  bool success = 1;\\n  bytes data = 2;\\n  string error = 3;\\n  int32 exit_code = 4;\\n  string error_code = 5;\\n}\\n\\n// --- Capabilities ---\\n\\nmessage CapabilitiesResponse {\\n  repeated string command_types = 1;\\n  int32 priority = 2;\\n}\\n\\n// --- Health & Version ---\\n\\nmessage HealthResponse {\\n  bool healthy = 1;\\n  int64 uptime_ms = 2;\\n  int32 active_commands = 3;\\n  int64 memory_bytes = 4;\\n  string message = 5;\\n}\\n\\nmessage VersionResponse {\\n  string name = 1;\\n  string version = 2;\\n  string git_sha = 3;\\n  string built_at = 4;\\n  map<string, string> metadata = 5;\\n}\\n\"","/// <reference path=\"./proto.d.ts\" />\n/**\n * The agent's gRPC contract, np-agent-v1 (contract/plugin.proto), loaded the\n * one way that works from source, from the bundle and from a compiled worker:\n * its text, inlined, parsed in memory, the well-known types it imports taken\n * from protobufjs's own. What the library's server and a client of it speak.\n */\n\nimport * as grpc from \"@grpc/grpc-js\";\nimport * as protoLoader from \"@grpc/proto-loader\";\n// protobufjs is CommonJS: Node finds no named export in it, only its default.\nimport protobuf from \"protobufjs\";\nimport contract from \"../../../../contract/plugin.proto\" with { type: \"text\" };\n\n/** The contract as gRPC loads it: the ExecutorPlugin service, at its package. */\nexport interface LoadedProto {\n  npagent: { plugin: { v1: { ExecutorPlugin: grpc.ServiceClientConstructor } } };\n}\n\n/** How the contract's messages are read: fields as the contract spells them, 64-bit integers as text, defaults filled, a oneof named. */\nconst LOADING: protoLoader.Options = { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true };\n\n/**\n * The contract, parsed from its text: no file is read or written. Its messages\n * encode to Buffers, the only bytes grpc-js writes: protobufjs looks Buffer up\n * through a `require` a bundle hides, and without it encodes to a plain\n * Uint8Array, so it is handed the runtime's own.\n */\nexport function loadPluginProto(): LoadedProto {\n  protobuf.util.Buffer = Buffer;\n  protobuf.configure();\n  const parsed = protobuf.parse(contract, { keepCase: true });\n  for (const imported of parsed.imports ?? []) {\n    parsed.root.addJSON(protobuf.common.get(imported)?.nested ?? {});\n  }\n  const definition = protoLoader.fromJSON(parsed.root.toJSON(), LOADING);\n  return grpc.loadPackageDefinition(definition) as unknown as LoadedProto;\n}\n"],"mappings":";;;;AAAA,IAAA,iBAAA;;;;;;;;;ACoBA,MAAM,UAA+B;CAAE,UAAU;CAAM,OAAO;CAAQ,OAAO;CAAQ,UAAU;CAAM,QAAQ;AAAK;;;;;;;AAQlH,SAAgB,kBAA+B;CAC7C,SAAS,KAAK,SAAS;CACvB,SAAS,UAAU;CACnB,MAAM,SAAS,SAAS,MAAMA,gBAAU,EAAE,UAAU,KAAK,CAAC;CAC1D,KAAK,MAAM,YAAY,OAAO,WAAW,CAAC,GACxC,OAAO,KAAK,QAAQ,SAAS,OAAO,IAAI,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;CAEjE,MAAM,aAAa,YAAY,SAAS,OAAO,KAAK,OAAO,GAAG,OAAO;CACrE,OAAO,KAAK,sBAAsB,UAAU;AAC9C"}