@zixt/host 0.0.13 → 0.0.14

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 (2) hide show
  1. package/dist/index.js +79 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ import { homedir } from "node:os";
31
31
  // package.json
32
32
  var package_default = {
33
33
  name: "@zixt/host",
34
- version: "0.0.13",
34
+ version: "0.0.14",
35
35
  type: "module",
36
36
  exports: {
37
37
  ".": "./src/client.ts",
@@ -15334,13 +15334,19 @@ var CreateOrgRequest = external_exports.object({
15334
15334
  });
15335
15335
  var DESKTOP_SIDEBAR_MIN_WIDTH_PX = 240;
15336
15336
  var DESKTOP_SIDEBAR_MAX_WIDTH_PX = 420;
15337
+ var TASK_SIDEBAR_MIN_WIDTH_PX = 240;
15338
+ var TASK_SIDEBAR_MAX_WIDTH_PX = 480;
15337
15339
  var DesktopSidebarPreference = external_exports.object({
15338
15340
  collapsed: external_exports.boolean(),
15339
15341
  /** Last expanded width; collapsing never discards the user's chosen width. */
15340
15342
  expandedWidthPx: external_exports.number().int().min(DESKTOP_SIDEBAR_MIN_WIDTH_PX).max(DESKTOP_SIDEBAR_MAX_WIDTH_PX)
15341
15343
  });
15344
+ var TaskSidebarPreference = external_exports.object({
15345
+ expandedWidthPx: external_exports.number().int().min(TASK_SIDEBAR_MIN_WIDTH_PX).max(TASK_SIDEBAR_MAX_WIDTH_PX)
15346
+ });
15342
15347
  var OrgUiPreferences = external_exports.object({
15343
15348
  desktopSidebar: DesktopSidebarPreference,
15349
+ taskSidebar: TaskSidebarPreference,
15344
15350
  /** Missing legacy storage is revision zero. */
15345
15351
  revision: external_exports.number().int().min(0),
15346
15352
  updatedAt: IsoDate2.nullable()
@@ -15349,9 +15355,16 @@ var DesktopSidebarPreferencePatch = DesktopSidebarPreference.partial().refine(
15349
15355
  (value) => Object.keys(value).length > 0,
15350
15356
  "empty desktop sidebar update"
15351
15357
  );
15358
+ var TaskSidebarPreferencePatch = TaskSidebarPreference.partial().refine(
15359
+ (value) => Object.keys(value).length > 0,
15360
+ "empty task sidebar update"
15361
+ );
15352
15362
  var UpdateOrgUiPreferencesRequest = external_exports.object({
15353
15363
  expectedRevision: external_exports.number().int().min(0),
15354
- desktopSidebar: DesktopSidebarPreferencePatch
15364
+ desktopSidebar: DesktopSidebarPreferencePatch.optional(),
15365
+ taskSidebar: TaskSidebarPreferencePatch.optional()
15366
+ }).refine((value) => value.desktopSidebar !== void 0 || value.taskSidebar !== void 0, {
15367
+ message: "at least one layout preference is required"
15355
15368
  });
15356
15369
  var ListOrgsResponse = external_exports.object({
15357
15370
  orgs: external_exports.array(Org.extend({ role: OrgRole, uiPreferences: OrgUiPreferences }))
@@ -15884,7 +15897,34 @@ var MemberTaskOriginProjection = TaskOrigin.pick({
15884
15897
  var MemberTaskCancellationProjection = TaskCancellation.omit({ hostId: true }).extend({
15885
15898
  hostId: external_exports.null()
15886
15899
  });
15887
- var AdminTaskProjection = Task.extend({ metadataRedacted: external_exports.literal(false) });
15900
+ var taskGitSummaryLabel = (maxLength, label) => external_exports.string().min(1).max(maxLength).refine(
15901
+ isSafeSingleLineDisplayText,
15902
+ `${label} must not contain control, line-separator, or bidirectional formatting characters`
15903
+ );
15904
+ var TaskGitSummary = external_exports.object({
15905
+ repositories: external_exports.array(
15906
+ external_exports.object({
15907
+ githubRepository: external_exports.string().regex(/^[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}$/).optional(),
15908
+ branch: taskGitSummaryLabel(512, "branch").nullable(),
15909
+ ahead: external_exports.number().int().min(0),
15910
+ behind: external_exports.number().int().min(0),
15911
+ changedFiles: external_exports.number().int().min(0),
15912
+ pullRequest: external_exports.object({
15913
+ number: external_exports.number().int().min(1),
15914
+ url: external_exports.string().max(2e3).regex(
15915
+ /^https:\/\/github\.com\/[A-Za-z0-9_.-]{1,100}\/[A-Za-z0-9_.-]{1,100}\/pull\/[1-9][0-9]*$/
15916
+ ),
15917
+ state: external_exports.enum(["open", "closed", "merged"]),
15918
+ draft: external_exports.boolean()
15919
+ }).strict().optional()
15920
+ }).strict()
15921
+ ).min(1).max(20),
15922
+ observedAt: IsoDate
15923
+ }).strict();
15924
+ var AdminTaskProjection = Task.extend({
15925
+ metadataRedacted: external_exports.literal(false),
15926
+ gitSummary: TaskGitSummary.nullable().optional()
15927
+ });
15888
15928
  var MemberTaskProjection = Task.omit({
15889
15929
  origin: true,
15890
15930
  hostId: true,
@@ -15893,7 +15933,8 @@ var MemberTaskProjection = Task.omit({
15893
15933
  metadataRedacted: external_exports.literal(true),
15894
15934
  origin: MemberTaskOriginProjection,
15895
15935
  hostId: external_exports.null(),
15896
- cancellation: MemberTaskCancellationProjection.nullable().default(null)
15936
+ cancellation: MemberTaskCancellationProjection.nullable().default(null),
15937
+ gitSummary: external_exports.null().optional()
15897
15938
  });
15898
15939
  var TaskProjection = external_exports.discriminatedUnion("metadataRedacted", [
15899
15940
  AdminTaskProjection,
@@ -33267,12 +33308,8 @@ function createCliRunner(adapter, opts = {}) {
33267
33308
  try {
33268
33309
  cwd = await requireRealDirectory4(configuredWorkspace, "configured workspace");
33269
33310
  } catch (error52) {
33270
- return {
33271
- outcome: "failed",
33272
- summary: error52 instanceof Error ? error52.message : "configured workspace is unusable",
33273
- summaryEvidence: "host_observed",
33274
- usage: { inputTokens: 0, outputTokens: 0 }
33275
- };
33311
+ const reason = error52 instanceof Error ? error52.message : "configured workspace is unusable";
33312
+ task.event("status", `${reason}. Continuing in the teammate folder instead.`);
33276
33313
  }
33277
33314
  }
33278
33315
  if (task.cancelledNow()) return cancelledBeforeRun();
@@ -33426,6 +33463,18 @@ function createCliRunner(adapter, opts = {}) {
33426
33463
  ];
33427
33464
  })
33428
33465
  });
33466
+ const workingContextEnvironments = buildWorkingContextCommandEnvironments({
33467
+ inherited: process.env,
33468
+ runnerEnv: env,
33469
+ ...githubShell ? { githubShellBrokerEnv: githubShell.environment } : {}
33470
+ });
33471
+ const gitDetected = preparedWorkspace !== null || await collectWorkingContext({
33472
+ workingDirectory: cwd,
33473
+ preparedWorkspace,
33474
+ git,
33475
+ env: workingContextEnvironments.git,
33476
+ signal: task.authoritySignal
33477
+ }).then((context) => Boolean(context.repositories?.length)).catch(() => false);
33429
33478
  const prepared = await adapter.prepareRun({
33430
33479
  task,
33431
33480
  runner,
@@ -33436,6 +33485,7 @@ function createCliRunner(adapter, opts = {}) {
33436
33485
  connections: attachedConnections
33437
33486
  },
33438
33487
  preparedWorkspace,
33488
+ gitDetected,
33439
33489
  // The trusted workspace facts describe where Zixt put provider clones,
33440
33490
  // which is always the Zixt-owned root — never a configured workspace.
33441
33491
  taskRoot,
@@ -33467,11 +33517,6 @@ ${attachmentSection}` : prepared.prompt;
33467
33517
  const abortWorkingContext = () => workingContextAbort.abort();
33468
33518
  task.authoritySignal.addEventListener("abort", abortWorkingContext, { once: true });
33469
33519
  const pullRequests = new WorkingContextPullRequestCache();
33470
- const workingContextEnvironments = buildWorkingContextCommandEnvironments({
33471
- inherited: process.env,
33472
- runnerEnv: env,
33473
- ...githubShell ? { githubShellBrokerEnv: githubShell.environment } : {}
33474
- });
33475
33520
  const ghContextCommand = githubShell?.ghCommand ? { ...githubShell.ghCommand, env: workingContextEnvironments.github } : void 0;
33476
33521
  const gitContextCommand = git.available && git.executablePath ? { executablePath: git.executablePath, env: workingContextEnvironments.git } : void 0;
33477
33522
  const reportWorkingContext = (options = {}) => {
@@ -33778,6 +33823,20 @@ function workspaceSystemPrompt(existing, workspacePath, siblings, gitDetected =
33778
33823
  "",
33779
33824
  "Your session ends the moment you finish a reply, and nothing wakes it: no background notification, watcher, or timer will ever re-invoke you. Run long commands (test gates, builds) synchronously and wait for their result inside the tool call. Never end a reply with work still in flight or a promise to report later: whatever you were waiting for dies with the turn. Your final reply is the report of record, written only when the work is actually complete."
33780
33825
  ];
33826
+ if (gitDetected) {
33827
+ lines.push(
33828
+ "",
33829
+ "# Finishing work in Git",
33830
+ "",
33831
+ "This folder is positively detected as a Git repository. Use installed `git` for local source control and, when the remote is GitHub, installed `gh` for pull requests, checks, and merges.",
33832
+ "",
33833
+ "Before editing, inspect the repository and call `list_tasks` to check whether another live Task overlaps this work. Never disturb another Task\u2019s checkout; use an isolated branch and worktree when work may be concurrent.",
33834
+ "",
33835
+ "Unless the human explicitly asked you to stop for review before merging, Git work is not complete merely because files, a branch, or a pull request exist. Update from the latest default branch, resolve ordinary conflicts yourself, run the relevant validation, commit, push, open or update the pull request when the repository uses them, wait for required checks, merge it, and verify the merged state. Clean up temporary worktrees after integration. Do not strand finished work on an unmerged branch.",
33836
+ "",
33837
+ "If repository policy, unavailable authority, an ambiguous product decision, or a conflict you cannot safely resolve prevents completion, use `ask_user` with the exact blocker and required decision. Do not report the Task as done while integration is still pending."
33838
+ );
33839
+ }
33781
33840
  if (siblings.length > 0) {
33782
33841
  const siblingData = promptDescriptiveJson(
33783
33842
  siblings.slice(0, 100).map((sibling) => ({
@@ -34316,7 +34375,8 @@ var claudeCodeAdapter = {
34316
34375
  input.mcp,
34317
34376
  input.preparedWorkspace,
34318
34377
  input.taskRoot,
34319
- input.cwd
34378
+ input.cwd,
34379
+ input.gitDetected
34320
34380
  );
34321
34381
  const sessionId = input.task.spec.sessionKey ?? randomUUID11();
34322
34382
  const observeRuntime = createRuntimeReporter(input, sessionId);
@@ -34367,7 +34427,7 @@ function delay2(ms) {
34367
34427
  timer.unref?.();
34368
34428
  });
34369
34429
  }
34370
- async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRoot, workspacePath = taskRoot ?? "") {
34430
+ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRoot, workspacePath = taskRoot ?? "", gitDetected = false) {
34371
34431
  const args = [
34372
34432
  // Hermetic, non-interactive run — no local slash commands or global state.
34373
34433
  "--disable-slash-commands",
@@ -34387,7 +34447,7 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
34387
34447
  trustedWorkspaceSystemPrompt(task.spec.system, preparedWorkspace, taskRoot),
34388
34448
  workspacePath,
34389
34449
  task.siblingTasks(),
34390
- preparedWorkspace !== null
34450
+ gitDetected
34391
34451
  );
34392
34452
  if (systemPrompt) {
34393
34453
  const promptPath = await artifacts.writeSystemPrompt(systemPrompt);
@@ -34641,7 +34701,7 @@ function createCodexAdapter(threadIndexRoot) {
34641
34701
  trustedWorkspaceSystemPrompt(task.spec.system, input.preparedWorkspace, input.taskRoot),
34642
34702
  input.cwd,
34643
34703
  task.siblingTasks(),
34644
- input.preparedWorkspace !== null
34704
+ input.gitDetected
34645
34705
  );
34646
34706
  const prompt = platformInstructions ? `<zixt_platform_instructions>
34647
34707
  ${platformInstructions}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",