@zixt/host 0.0.12 → 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 +99 -20
  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.12",
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,
@@ -17232,6 +17273,9 @@ var SecretMeta = external_exports.object({
17232
17273
  /** Absent on legacy rows/clients means `env`. */
17233
17274
  kind: SecretKind.default("env"),
17234
17275
  scope: SecretScope,
17276
+ /** Canonical availability set for teammate-scoped credentials. */
17277
+ agentIds: external_exports.array(AgentId).min(1).nullable().default(null),
17278
+ /** Legacy single-teammate projection, retained while older clients migrate. */
17235
17279
  agentId: AgentId.nullable(),
17236
17280
  /**
17237
17281
  * What this credential is for — rendered into the agent's system prompt
@@ -17279,7 +17323,23 @@ var requireKindMatchingValue = (request, ctx) => {
17279
17323
  };
17280
17324
  var PutSecretRequest = external_exports.discriminatedUnion("scope", [
17281
17325
  external_exports.object({ ...PutSecretFields, scope: external_exports.literal("org") }).strict().superRefine(requireKindMatchingValue),
17282
- external_exports.object({ ...PutSecretFields, scope: external_exports.literal("agent"), agentId: AgentId }).strict().superRefine(requireKindMatchingValue)
17326
+ external_exports.object({
17327
+ ...PutSecretFields,
17328
+ scope: external_exports.literal("agent"),
17329
+ agentIds: external_exports.array(AgentId).min(1).max(100).optional(),
17330
+ agentId: AgentId.optional()
17331
+ }).strict().superRefine((request, ctx) => {
17332
+ if (request.agentIds === void 0 === (request.agentId === void 0)) {
17333
+ ctx.addIssue({
17334
+ code: "custom",
17335
+ path: ["agentIds"],
17336
+ message: "teammate credentials require exactly one of agentIds or legacy agentId"
17337
+ });
17338
+ }
17339
+ if (request.agentIds && new Set(request.agentIds).size !== request.agentIds.length) {
17340
+ ctx.addIssue({ code: "custom", path: ["agentIds"], message: "duplicate AI teammate" });
17341
+ }
17342
+ }).superRefine(requireKindMatchingValue)
17283
17343
  ]);
17284
17344
  var AdminSecretsProjection = external_exports.object({
17285
17345
  metadataRedacted: external_exports.literal(false),
@@ -33248,12 +33308,8 @@ function createCliRunner(adapter, opts = {}) {
33248
33308
  try {
33249
33309
  cwd = await requireRealDirectory4(configuredWorkspace, "configured workspace");
33250
33310
  } catch (error52) {
33251
- return {
33252
- outcome: "failed",
33253
- summary: error52 instanceof Error ? error52.message : "configured workspace is unusable",
33254
- summaryEvidence: "host_observed",
33255
- usage: { inputTokens: 0, outputTokens: 0 }
33256
- };
33311
+ const reason = error52 instanceof Error ? error52.message : "configured workspace is unusable";
33312
+ task.event("status", `${reason}. Continuing in the teammate folder instead.`);
33257
33313
  }
33258
33314
  }
33259
33315
  if (task.cancelledNow()) return cancelledBeforeRun();
@@ -33407,6 +33463,18 @@ function createCliRunner(adapter, opts = {}) {
33407
33463
  ];
33408
33464
  })
33409
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);
33410
33478
  const prepared = await adapter.prepareRun({
33411
33479
  task,
33412
33480
  runner,
@@ -33417,6 +33485,7 @@ function createCliRunner(adapter, opts = {}) {
33417
33485
  connections: attachedConnections
33418
33486
  },
33419
33487
  preparedWorkspace,
33488
+ gitDetected,
33420
33489
  // The trusted workspace facts describe where Zixt put provider clones,
33421
33490
  // which is always the Zixt-owned root — never a configured workspace.
33422
33491
  taskRoot,
@@ -33448,11 +33517,6 @@ ${attachmentSection}` : prepared.prompt;
33448
33517
  const abortWorkingContext = () => workingContextAbort.abort();
33449
33518
  task.authoritySignal.addEventListener("abort", abortWorkingContext, { once: true });
33450
33519
  const pullRequests = new WorkingContextPullRequestCache();
33451
- const workingContextEnvironments = buildWorkingContextCommandEnvironments({
33452
- inherited: process.env,
33453
- runnerEnv: env,
33454
- ...githubShell ? { githubShellBrokerEnv: githubShell.environment } : {}
33455
- });
33456
33520
  const ghContextCommand = githubShell?.ghCommand ? { ...githubShell.ghCommand, env: workingContextEnvironments.github } : void 0;
33457
33521
  const gitContextCommand = git.available && git.executablePath ? { executablePath: git.executablePath, env: workingContextEnvironments.git } : void 0;
33458
33522
  const reportWorkingContext = (options = {}) => {
@@ -33759,6 +33823,20 @@ function workspaceSystemPrompt(existing, workspacePath, siblings, gitDetected =
33759
33823
  "",
33760
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."
33761
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
+ }
33762
33840
  if (siblings.length > 0) {
33763
33841
  const siblingData = promptDescriptiveJson(
33764
33842
  siblings.slice(0, 100).map((sibling) => ({
@@ -34297,7 +34375,8 @@ var claudeCodeAdapter = {
34297
34375
  input.mcp,
34298
34376
  input.preparedWorkspace,
34299
34377
  input.taskRoot,
34300
- input.cwd
34378
+ input.cwd,
34379
+ input.gitDetected
34301
34380
  );
34302
34381
  const sessionId = input.task.spec.sessionKey ?? randomUUID11();
34303
34382
  const observeRuntime = createRuntimeReporter(input, sessionId);
@@ -34348,7 +34427,7 @@ function delay2(ms) {
34348
34427
  timer.unref?.();
34349
34428
  });
34350
34429
  }
34351
- 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) {
34352
34431
  const args = [
34353
34432
  // Hermetic, non-interactive run — no local slash commands or global state.
34354
34433
  "--disable-slash-commands",
@@ -34368,7 +34447,7 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
34368
34447
  trustedWorkspaceSystemPrompt(task.spec.system, preparedWorkspace, taskRoot),
34369
34448
  workspacePath,
34370
34449
  task.siblingTasks(),
34371
- preparedWorkspace !== null
34450
+ gitDetected
34372
34451
  );
34373
34452
  if (systemPrompt) {
34374
34453
  const promptPath = await artifacts.writeSystemPrompt(systemPrompt);
@@ -34622,7 +34701,7 @@ function createCodexAdapter(threadIndexRoot) {
34622
34701
  trustedWorkspaceSystemPrompt(task.spec.system, input.preparedWorkspace, input.taskRoot),
34623
34702
  input.cwd,
34624
34703
  task.siblingTasks(),
34625
- input.preparedWorkspace !== null
34704
+ input.gitDetected
34626
34705
  );
34627
34706
  const prompt = platformInstructions ? `<zixt_platform_instructions>
34628
34707
  ${platformInstructions}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",