@senpiper/sp-agent 0.1.2 → 0.1.3

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.
@@ -36,6 +36,6 @@ export declare function createSpMainOptions(): Promise<MainOptions>;
36
36
  export declare const requiredExtension: {
37
37
  readonly name: "@senpiper/sp-agent-extensions";
38
38
  readonly version: "0.1.0";
39
- readonly digest: "sha256:66e515b3ea83f563d2f031e66c676b8e76f0a753b1ff14de210648055435205f";
39
+ readonly digest: "sha256:e7fd815e7e41326441d7e236bb6875ff35fb1fd968e2ce3f64c8194e0d271979";
40
40
  };
41
41
  //# sourceMappingURL=distribution.d.ts.map
@@ -6,7 +6,7 @@ export declare const EMBEDDED_REQUIRED_EXTENSION_IDENTITY: {
6
6
  readonly artifact: {
7
7
  readonly name: "@senpiper/sp-agent-extensions";
8
8
  readonly version: "0.1.0";
9
- readonly digest: "sha256:66e515b3ea83f563d2f031e66c676b8e76f0a753b1ff14de210648055435205f";
9
+ readonly digest: "sha256:e7fd815e7e41326441d7e236bb6875ff35fb1fd968e2ce3f64c8194e0d271979";
10
10
  };
11
11
  };
12
12
  //# sourceMappingURL=extension-identity.generated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension-identity.generated.d.ts","sourceRoot":"","sources":["../src/extension-identity.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oCAAoC;;;;;;;;;;CAUvC,CAAC","sourcesContent":["// Generated by scripts/generate-sp-extension-identity.mjs. Do not edit.\nexport const EMBEDDED_REQUIRED_EXTENSION_IDENTITY = {\n\trequired: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t},\n\tartifact: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t\tdigest: \"sha256:66e515b3ea83f563d2f031e66c676b8e76f0a753b1ff14de210648055435205f\",\n\t},\n} as const;\n"]}
1
+ {"version":3,"file":"extension-identity.generated.d.ts","sourceRoot":"","sources":["../src/extension-identity.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oCAAoC;;;;;;;;;;CAUvC,CAAC","sourcesContent":["// Generated by scripts/generate-sp-extension-identity.mjs. Do not edit.\nexport const EMBEDDED_REQUIRED_EXTENSION_IDENTITY = {\n\trequired: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t},\n\tartifact: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t\tdigest: \"sha256:e7fd815e7e41326441d7e236bb6875ff35fb1fd968e2ce3f64c8194e0d271979\",\n\t},\n} as const;\n"]}
@@ -7,7 +7,7 @@ export const EMBEDDED_REQUIRED_EXTENSION_IDENTITY = {
7
7
  artifact: {
8
8
  name: "@senpiper/sp-agent-extensions",
9
9
  version: "0.1.0",
10
- digest: "sha256:66e515b3ea83f563d2f031e66c676b8e76f0a753b1ff14de210648055435205f",
10
+ digest: "sha256:e7fd815e7e41326441d7e236bb6875ff35fb1fd968e2ce3f64c8194e0d271979",
11
11
  },
12
12
  };
13
13
  //# sourceMappingURL=extension-identity.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension-identity.generated.js","sourceRoot":"","sources":["../src/extension-identity.generated.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD,QAAQ,EAAE;QACT,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;KAChB;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,yEAAyE;KACjF;CACQ,CAAC","sourcesContent":["// Generated by scripts/generate-sp-extension-identity.mjs. Do not edit.\nexport const EMBEDDED_REQUIRED_EXTENSION_IDENTITY = {\n\trequired: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t},\n\tartifact: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t\tdigest: \"sha256:66e515b3ea83f563d2f031e66c676b8e76f0a753b1ff14de210648055435205f\",\n\t},\n} as const;\n"]}
1
+ {"version":3,"file":"extension-identity.generated.js","sourceRoot":"","sources":["../src/extension-identity.generated.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD,QAAQ,EAAE;QACT,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;KAChB;IACD,QAAQ,EAAE;QACT,IAAI,EAAE,+BAA+B;QACrC,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,yEAAyE;KACjF;CACQ,CAAC","sourcesContent":["// Generated by scripts/generate-sp-extension-identity.mjs. Do not edit.\nexport const EMBEDDED_REQUIRED_EXTENSION_IDENTITY = {\n\trequired: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t},\n\tartifact: {\n\t\tname: \"@senpiper/sp-agent-extensions\",\n\t\tversion: \"0.1.0\",\n\t\tdigest: \"sha256:e7fd815e7e41326441d7e236bb6875ff35fb1fd968e2ce3f64c8194e0d271979\",\n\t},\n} as const;\n"]}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SP_AGENT_VERSION = "0.1.2";
1
+ export declare const SP_AGENT_VERSION = "0.1.3";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAAU,CAAC","sourcesContent":["export const SP_AGENT_VERSION = \"0.1.2\";\n"]}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,UAAU,CAAC","sourcesContent":["export const SP_AGENT_VERSION = \"0.1.3\";\n"]}
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const SP_AGENT_VERSION = "0.1.2";
1
+ export const SP_AGENT_VERSION = "0.1.3";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC","sourcesContent":["export const SP_AGENT_VERSION = \"0.1.2\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC","sourcesContent":["export const SP_AGENT_VERSION = \"0.1.3\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"startup-header.d.ts","sourceRoot":"","sources":["../src/startup-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAYrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,UAAQ,YAoB5G;AAED,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc,sBAEpE;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QAWvD","sourcesContent":["import type { ExtensionAPI, StartupMessage, Theme } from \"@senpiper/pi-coding-agent\";\nimport { truncateToWidth } from \"@senpiper/pi-coding-agent/runtime-deps\";\nimport { readSpGatewayState } from \"./gateway.ts\";\n\nconst LLM_IN_A_BOX_BANNER = [\n\t\" _ _ __ __ ___ _ _ _ ____ ___ __ __\",\n\t\"| | | | | \\\\/ | |_ _| \\\\ | | / \\\\ | __ ) / _ \\\\ \\\\ \\\\/ /\",\n\t\"| | | | | |\\\\/| | | || \\\\| | / _ \\\\ | _ \\\\| | | | \\\\ /\",\n\t\"| |___| |___| | | | | || |\\\\ | / ___ \\\\ | |_) | |_| | / \\\\ \",\n\t\"|_____|_____|_| |_| |___|_| \\\\_| /_/ \\\\_\\\\ |____/ \\\\___/ /_/\\\\_\\\\\",\n];\n\nexport function renderSpStartupHeader(theme: Theme, width: number, modelId?: string, gatewayConnected = false) {\n\tconst availableWidth = Math.max(1, width);\n\tconst truncateLine = (line: string) => truncateToWidth(line, availableWidth);\n\tconst status = `sp-gateway: ${gatewayConnected ? \"connected\" : \"not configured\"} · model: ${modelId ?? \"not selected\"}`;\n\tconst commands = \"/login · /model · /onboarding · /btw\";\n\n\tif (availableWidth < 68) {\n\t\treturn [\n\t\t\ttruncateLine(theme.bold(theme.fg(\"accent\", \"LLM IN A BOX\")) + theme.fg(\"dim\", \" · powered by Senpiper\")),\n\t\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t\t];\n\t}\n\n\treturn [\n\t\t...LLM_IN_A_BOX_BANNER.map((line) => truncateLine(theme.bold(theme.fg(\"accent\", line)))),\n\t\ttruncateLine(theme.fg(\"dim\", \"powered by Senpiper\")),\n\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t];\n}\n\nexport function filterSpStartupMessage(startupMessage: StartupMessage) {\n\treturn startupMessage.type === \"no-model\" ? undefined : startupMessage.message;\n}\n\nexport function registerSpStartupHeader(pi: ExtensionAPI) {\n\tpi.registerStartupMessageFilter(filterSpStartupMessage);\n\tpi.on(\"session_start\", async (_event, context) => {\n\t\tif (context.mode !== \"tui\") return;\n\t\tcontext.ui.setHeader((_tui, theme) => ({\n\t\t\trender(width) {\n\t\t\t\treturn renderSpStartupHeader(theme, width, context.model?.id, readSpGatewayState() !== undefined);\n\t\t\t},\n\t\t\tinvalidate() {},\n\t\t}));\n\t});\n}\n"]}
1
+ {"version":3,"file":"startup-header.d.ts","sourceRoot":"","sources":["../src/startup-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAYrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,gBAAgB,UAAQ,YAyB5G;AAED,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc,sBAEpE;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,QAWvD","sourcesContent":["import type { ExtensionAPI, StartupMessage, Theme } from \"@senpiper/pi-coding-agent\";\nimport { truncateToWidth } from \"@senpiper/pi-coding-agent/runtime-deps\";\nimport { readSpGatewayState } from \"./gateway.ts\";\n\nconst LLM_IN_A_BOX_BANNER = [\n\t\" _ _ __ __ ___ _ _ _ ____ ___ __ __\",\n\t\"| | | | | \\\\/ | |_ _| \\\\ | | / \\\\ | __ ) / _ \\\\ \\\\ \\\\/ /\",\n\t\"| | | | | |\\\\/| | | || \\\\| | / _ \\\\ | _ \\\\| | | | \\\\ /\",\n\t\"| |___| |___| | | | | || |\\\\ | / ___ \\\\ | |_) | |_| | / \\\\ \",\n\t\"|_____|_____|_| |_| |___|_| \\\\_| /_/ \\\\_\\\\ |____/ \\\\___/ /_/\\\\_\\\\\",\n];\n\nexport function renderSpStartupHeader(theme: Theme, width: number, modelId?: string, gatewayConnected = false) {\n\tconst availableWidth = Math.max(1, width);\n\tconst truncateLine = (line: string) => truncateToWidth(line, availableWidth);\n\tconst status = `sp-gateway: ${gatewayConnected ? \"connected\" : \"not configured\"} · model: ${modelId ?? \"not selected\"}`;\n\tconst loginPrompt = gatewayConnected\n\t\t? []\n\t\t: [truncateLine(theme.bold(theme.fg(\"warning\", \"Not logged in. Run /login to continue.\")))];\n\tconst commands = \"/login · /model · /onboarding · /btw\";\n\n\tif (availableWidth < 68) {\n\t\treturn [\n\t\t\ttruncateLine(theme.bold(theme.fg(\"accent\", \"LLM IN A BOX\")) + theme.fg(\"dim\", \" · powered by Senpiper\")),\n\t\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t\t...loginPrompt,\n\t\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t\t];\n\t}\n\n\treturn [\n\t\t...LLM_IN_A_BOX_BANNER.map((line) => truncateLine(theme.bold(theme.fg(\"accent\", line)))),\n\t\ttruncateLine(theme.fg(\"dim\", \"powered by Senpiper\")),\n\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t...loginPrompt,\n\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t];\n}\n\nexport function filterSpStartupMessage(startupMessage: StartupMessage) {\n\treturn startupMessage.type === \"no-model\" ? undefined : startupMessage.message;\n}\n\nexport function registerSpStartupHeader(pi: ExtensionAPI) {\n\tpi.registerStartupMessageFilter(filterSpStartupMessage);\n\tpi.on(\"session_start\", async (_event, context) => {\n\t\tif (context.mode !== \"tui\") return;\n\t\tcontext.ui.setHeader((_tui, theme) => ({\n\t\t\trender(width) {\n\t\t\t\treturn renderSpStartupHeader(theme, width, context.model?.id, readSpGatewayState() !== undefined);\n\t\t\t},\n\t\t\tinvalidate() {},\n\t\t}));\n\t});\n}\n"]}
@@ -11,11 +11,15 @@ export function renderSpStartupHeader(theme, width, modelId, gatewayConnected =
11
11
  const availableWidth = Math.max(1, width);
12
12
  const truncateLine = (line) => truncateToWidth(line, availableWidth);
13
13
  const status = `sp-gateway: ${gatewayConnected ? "connected" : "not configured"} · model: ${modelId ?? "not selected"}`;
14
+ const loginPrompt = gatewayConnected
15
+ ? []
16
+ : [truncateLine(theme.bold(theme.fg("warning", "Not logged in. Run /login to continue.")))];
14
17
  const commands = "/login · /model · /onboarding · /btw";
15
18
  if (availableWidth < 68) {
16
19
  return [
17
20
  truncateLine(theme.bold(theme.fg("accent", "LLM IN A BOX")) + theme.fg("dim", " · powered by Senpiper")),
18
21
  truncateLine(theme.fg("muted", status)),
22
+ ...loginPrompt,
19
23
  truncateLine(theme.fg("dim", commands)),
20
24
  ];
21
25
  }
@@ -23,6 +27,7 @@ export function renderSpStartupHeader(theme, width, modelId, gatewayConnected =
23
27
  ...LLM_IN_A_BOX_BANNER.map((line) => truncateLine(theme.bold(theme.fg("accent", line)))),
24
28
  truncateLine(theme.fg("dim", "powered by Senpiper")),
25
29
  truncateLine(theme.fg("muted", status)),
30
+ ...loginPrompt,
26
31
  truncateLine(theme.fg("dim", commands)),
27
32
  ];
28
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"startup-header.js","sourceRoot":"","sources":["../src/startup-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,mBAAmB,GAAG;IAC3B,gEAAgE;IAChE,sEAAsE;IACtE,oEAAoE;IACpE,mEAAmE;IACnE,sEAAsE;CACtE,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,KAAY,EAAE,KAAa,EAAE,OAAgB,EAAE,gBAAgB,GAAG,KAAK,EAAE;IAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,eAAe,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,cAAa,OAAO,IAAI,cAAc,EAAE,CAAC;IACxH,MAAM,QAAQ,GAAG,yCAAsC,CAAC;IAExD,IAAI,cAAc,GAAG,EAAE,EAAE,CAAC;QACzB,OAAO;YACN,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAwB,CAAC,CAAC;YACxG,YAAY,CAAC,KAAK,CAAC,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,UAAU,GAAG,EAAC,CAAC;SACf,CAAC,CAAC,CAAC;IAAA,CACJ,CAAC,CAAC;AAAA,CACH","sourcesContent":["import type { ExtensionAPI, StartupMessage, Theme } from \"@senpiper/pi-coding-agent\";\nimport { truncateToWidth } from \"@senpiper/pi-coding-agent/runtime-deps\";\nimport { readSpGatewayState } from \"./gateway.ts\";\n\nconst LLM_IN_A_BOX_BANNER = [\n\t\" _ _ __ __ ___ _ _ _ ____ ___ __ __\",\n\t\"| | | | | \\\\/ | |_ _| \\\\ | | / \\\\ | __ ) / _ \\\\ \\\\ \\\\/ /\",\n\t\"| | | | | |\\\\/| | | || \\\\| | / _ \\\\ | _ \\\\| | | | \\\\ /\",\n\t\"| |___| |___| | | | | || |\\\\ | / ___ \\\\ | |_) | |_| | / \\\\ \",\n\t\"|_____|_____|_| |_| |___|_| \\\\_| /_/ \\\\_\\\\ |____/ \\\\___/ /_/\\\\_\\\\\",\n];\n\nexport function renderSpStartupHeader(theme: Theme, width: number, modelId?: string, gatewayConnected = false) {\n\tconst availableWidth = Math.max(1, width);\n\tconst truncateLine = (line: string) => truncateToWidth(line, availableWidth);\n\tconst status = `sp-gateway: ${gatewayConnected ? \"connected\" : \"not configured\"} · model: ${modelId ?? \"not selected\"}`;\n\tconst commands = \"/login · /model · /onboarding · /btw\";\n\n\tif (availableWidth < 68) {\n\t\treturn [\n\t\t\ttruncateLine(theme.bold(theme.fg(\"accent\", \"LLM IN A BOX\")) + theme.fg(\"dim\", \" · powered by Senpiper\")),\n\t\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t\t];\n\t}\n\n\treturn [\n\t\t...LLM_IN_A_BOX_BANNER.map((line) => truncateLine(theme.bold(theme.fg(\"accent\", line)))),\n\t\ttruncateLine(theme.fg(\"dim\", \"powered by Senpiper\")),\n\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t];\n}\n\nexport function filterSpStartupMessage(startupMessage: StartupMessage) {\n\treturn startupMessage.type === \"no-model\" ? undefined : startupMessage.message;\n}\n\nexport function registerSpStartupHeader(pi: ExtensionAPI) {\n\tpi.registerStartupMessageFilter(filterSpStartupMessage);\n\tpi.on(\"session_start\", async (_event, context) => {\n\t\tif (context.mode !== \"tui\") return;\n\t\tcontext.ui.setHeader((_tui, theme) => ({\n\t\t\trender(width) {\n\t\t\t\treturn renderSpStartupHeader(theme, width, context.model?.id, readSpGatewayState() !== undefined);\n\t\t\t},\n\t\t\tinvalidate() {},\n\t\t}));\n\t});\n}\n"]}
1
+ {"version":3,"file":"startup-header.js","sourceRoot":"","sources":["../src/startup-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,mBAAmB,GAAG;IAC3B,gEAAgE;IAChE,sEAAsE;IACtE,oEAAoE;IACpE,mEAAmE;IACnE,sEAAsE;CACtE,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,KAAY,EAAE,KAAa,EAAE,OAAgB,EAAE,gBAAgB,GAAG,KAAK,EAAE;IAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,eAAe,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,cAAa,OAAO,IAAI,cAAc,EAAE,CAAC;IACxH,MAAM,WAAW,GAAG,gBAAgB;QACnC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC,CAAC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AE,EAAE,CAAC;QACjD,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK;YAAE,OAAO;QACnC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACtC,MAAM,CAAC,KAAK,EAAE;gBACb,OAAO,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,SAAS,CAAC,CAAC;YAAA,CAClG;YACD,UAAU,GAAG,EAAC,CAAC;SACf,CAAC,CAAC,CAAC;IAAA,CACJ,CAAC,CAAC;AAAA,CACH","sourcesContent":["import type { ExtensionAPI, StartupMessage, Theme } from \"@senpiper/pi-coding-agent\";\nimport { truncateToWidth } from \"@senpiper/pi-coding-agent/runtime-deps\";\nimport { readSpGatewayState } from \"./gateway.ts\";\n\nconst LLM_IN_A_BOX_BANNER = [\n\t\" _ _ __ __ ___ _ _ _ ____ ___ __ __\",\n\t\"| | | | | \\\\/ | |_ _| \\\\ | | / \\\\ | __ ) / _ \\\\ \\\\ \\\\/ /\",\n\t\"| | | | | |\\\\/| | | || \\\\| | / _ \\\\ | _ \\\\| | | | \\\\ /\",\n\t\"| |___| |___| | | | | || |\\\\ | / ___ \\\\ | |_) | |_| | / \\\\ \",\n\t\"|_____|_____|_| |_| |___|_| \\\\_| /_/ \\\\_\\\\ |____/ \\\\___/ /_/\\\\_\\\\\",\n];\n\nexport function renderSpStartupHeader(theme: Theme, width: number, modelId?: string, gatewayConnected = false) {\n\tconst availableWidth = Math.max(1, width);\n\tconst truncateLine = (line: string) => truncateToWidth(line, availableWidth);\n\tconst status = `sp-gateway: ${gatewayConnected ? \"connected\" : \"not configured\"} · model: ${modelId ?? \"not selected\"}`;\n\tconst loginPrompt = gatewayConnected\n\t\t? []\n\t\t: [truncateLine(theme.bold(theme.fg(\"warning\", \"Not logged in. Run /login to continue.\")))];\n\tconst commands = \"/login · /model · /onboarding · /btw\";\n\n\tif (availableWidth < 68) {\n\t\treturn [\n\t\t\ttruncateLine(theme.bold(theme.fg(\"accent\", \"LLM IN A BOX\")) + theme.fg(\"dim\", \" · powered by Senpiper\")),\n\t\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t\t...loginPrompt,\n\t\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t\t];\n\t}\n\n\treturn [\n\t\t...LLM_IN_A_BOX_BANNER.map((line) => truncateLine(theme.bold(theme.fg(\"accent\", line)))),\n\t\ttruncateLine(theme.fg(\"dim\", \"powered by Senpiper\")),\n\t\ttruncateLine(theme.fg(\"muted\", status)),\n\t\t...loginPrompt,\n\t\ttruncateLine(theme.fg(\"dim\", commands)),\n\t];\n}\n\nexport function filterSpStartupMessage(startupMessage: StartupMessage) {\n\treturn startupMessage.type === \"no-model\" ? undefined : startupMessage.message;\n}\n\nexport function registerSpStartupHeader(pi: ExtensionAPI) {\n\tpi.registerStartupMessageFilter(filterSpStartupMessage);\n\tpi.on(\"session_start\", async (_event, context) => {\n\t\tif (context.mode !== \"tui\") return;\n\t\tcontext.ui.setHeader((_tui, theme) => ({\n\t\t\trender(width) {\n\t\t\t\treturn renderSpStartupHeader(theme, width, context.model?.id, readSpGatewayState() !== undefined);\n\t\t\t},\n\t\t\tinvalidate() {},\n\t\t}));\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senpiper/sp-agent",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Policy-bound Senpiper distribution of Pi",
5
5
  "type": "module",
6
6
  "piConfig": {