@selesai/code 0.3.3 → 0.3.6

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 (37) hide show
  1. package/dist/config.d.ts +1 -1
  2. package/dist/config.d.ts.map +1 -1
  3. package/dist/config.js +24 -1
  4. package/dist/config.js.map +1 -1
  5. package/dist/core/git-command.d.ts +9 -0
  6. package/dist/core/git-command.d.ts.map +1 -0
  7. package/dist/core/git-command.js +49 -0
  8. package/dist/core/git-command.js.map +1 -0
  9. package/dist/core/slash-commands.d.ts.map +1 -1
  10. package/dist/core/slash-commands.js +1 -0
  11. package/dist/core/slash-commands.js.map +1 -1
  12. package/dist/extensions/handoff-new.test.ts +210 -0
  13. package/dist/extensions/handoff-new.ts +172 -0
  14. package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  15. package/dist/extensions/package.json +1 -1
  16. package/dist/extensions/test-resolve-hook-impl.mjs +7 -0
  17. package/dist/extensions/test-resolve-hook.mjs +7 -0
  18. package/dist/extensions/tokenin-onboarding.ts +12 -0
  19. package/dist/extensions/workflow/adapter.ts +162 -6
  20. package/dist/extensions/workflow/modes/prototype.ts +42 -17
  21. package/dist/extensions/workflow/modes/quick.ts +40 -17
  22. package/dist/extensions/workflow/state-machine.ts +117 -15
  23. package/dist/extensions/workflow/validators.ts +42 -0
  24. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  25. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  26. package/dist/modes/interactive/interactive-mode.js +31 -0
  27. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  28. package/dist/package-manager-cli.d.ts.map +1 -1
  29. package/dist/package-manager-cli.js +23 -8
  30. package/dist/package-manager-cli.js.map +1 -1
  31. package/dist/skills/improve-codebase/SKILL.md +2 -2
  32. package/dist/utils/version-check.d.ts +3 -0
  33. package/dist/utils/version-check.d.ts.map +1 -1
  34. package/dist/utils/version-check.js +19 -0
  35. package/dist/utils/version-check.js.map +1 -1
  36. package/docs/workflows.md +21 -24
  37. package/package.json +5 -5
@@ -21,6 +21,7 @@ import { DefaultPackageManager } from "../../core/package-manager.js";
21
21
  import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-names.js";
22
22
  import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
23
23
  import { SessionManager } from "../../core/session-manager.js";
24
+ import { buildGitCommandPrompt, GIT_COMMAND_MODES } from "../../core/git-command.js";
24
25
  import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
25
26
  import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
26
27
  import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
@@ -344,6 +345,16 @@ export class InteractiveMode {
344
345
  }));
345
346
  };
346
347
  }
348
+ const gitCommand = slashCommands.find((command) => command.name === "git");
349
+ if (gitCommand) {
350
+ gitCommand.getArgumentCompletions = (prefix) => {
351
+ const lowerPrefix = prefix.toLowerCase();
352
+ const items = GIT_COMMAND_MODES.filter((mode) => [mode.name, ...mode.aliases].some((name) => name.toLowerCase().startsWith(lowerPrefix)));
353
+ return items.length > 0
354
+ ? items.map((mode) => ({ value: mode.name, label: mode.name, description: mode.description }))
355
+ : null;
356
+ };
357
+ }
347
358
  // Convert prompt templates to SlashCommand format for autocomplete
348
359
  const templateCommands = this.session.promptTemplates.map((cmd) => ({
349
360
  name: cmd.name,
@@ -2049,6 +2060,22 @@ export class InteractiveMode {
2049
2060
  this.pendingInputImages = [];
2050
2061
  return images;
2051
2062
  }
2063
+ async handleGitCommand(text, images) {
2064
+ const prompt = buildGitCommandPrompt(text.slice(4).trim());
2065
+ this.editor.addToHistory?.(text);
2066
+ this.editor.setText("");
2067
+ if (this.session.isCompacting) {
2068
+ this.queueCompactionMessage(prompt, "steer", images);
2069
+ return;
2070
+ }
2071
+ if (this.session.isStreaming) {
2072
+ await this.session.prompt(prompt, { streamingBehavior: "steer", images });
2073
+ this.updatePendingMessagesDisplay();
2074
+ this.ui.requestRender();
2075
+ return;
2076
+ }
2077
+ await this.session.prompt(prompt, { images });
2078
+ }
2052
2079
  setupEditorSubmitHandler() {
2053
2080
  this.defaultEditor.onSubmit = async (text) => {
2054
2081
  text = text.trim();
@@ -2112,6 +2139,10 @@ export class InteractiveMode {
2112
2139
  this.editor.setText("");
2113
2140
  return;
2114
2141
  }
2142
+ if (text === "/git" || text.startsWith("/git ")) {
2143
+ await this.handleGitCommand(text, images);
2144
+ return;
2145
+ }
2115
2146
  if (text === "/fork") {
2116
2147
  this.showUserMessageSelector();
2117
2148
  this.editor.setText("");