@github/copilot-sdk 1.0.7 → 1.0.8-preview.0
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.
- package/dist/cjs/generated/rpc.js +74 -2
- package/dist/generated/rpc.d.ts +515 -5
- package/dist/generated/rpc.js +74 -2
- package/dist/generated/session-events.d.ts +188 -1
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +42 -0
- package/package.json +2 -2
|
@@ -762,6 +762,68 @@ function createSessionRpc(connection, sessionId) {
|
|
|
762
762
|
}
|
|
763
763
|
},
|
|
764
764
|
/** @experimental */
|
|
765
|
+
factory: {
|
|
766
|
+
/**
|
|
767
|
+
* Runs a registered factory by name at the top level.
|
|
768
|
+
*
|
|
769
|
+
* @param params Parameters for invoking a registered factory.
|
|
770
|
+
*
|
|
771
|
+
* @returns Complete current or terminal factory run envelope.
|
|
772
|
+
*/
|
|
773
|
+
run: async (params) => connection.sendRequest("session.factory.run", { sessionId, ...params }),
|
|
774
|
+
/**
|
|
775
|
+
* Gets the current or settled envelope for a factory run.
|
|
776
|
+
*
|
|
777
|
+
* @param params Parameters for retrieving a factory run.
|
|
778
|
+
*
|
|
779
|
+
* @returns Complete current or terminal factory run envelope.
|
|
780
|
+
*/
|
|
781
|
+
getRun: async (params) => connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
|
|
782
|
+
/**
|
|
783
|
+
* Requests cancellation of a factory run and returns its run envelope.
|
|
784
|
+
*
|
|
785
|
+
* @param params Parameters for cancelling a factory run.
|
|
786
|
+
*
|
|
787
|
+
* @returns Complete current or terminal factory run envelope.
|
|
788
|
+
*/
|
|
789
|
+
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
790
|
+
/**
|
|
791
|
+
* Records a batch of ordered factory progress lines.
|
|
792
|
+
*
|
|
793
|
+
* @param params Parameters for recording factory progress.
|
|
794
|
+
*
|
|
795
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
796
|
+
*/
|
|
797
|
+
log: async (params) => connection.sendRequest("session.factory.log", { sessionId, ...params }),
|
|
798
|
+
/**
|
|
799
|
+
* Runs one factory-scoped subagent and returns its result.
|
|
800
|
+
*
|
|
801
|
+
* @param params Parameters for one factory-scoped subagent call.
|
|
802
|
+
*
|
|
803
|
+
* @returns Result of one factory-scoped subagent call.
|
|
804
|
+
*/
|
|
805
|
+
agent: async (params) => connection.sendRequest("session.factory.agent", { sessionId, ...params }),
|
|
806
|
+
/** @experimental */
|
|
807
|
+
journal: {
|
|
808
|
+
/**
|
|
809
|
+
* Reads a memoized factory journal entry.
|
|
810
|
+
*
|
|
811
|
+
* @param params Parameters for reading a factory journal entry.
|
|
812
|
+
*
|
|
813
|
+
* @returns Result of reading a factory journal entry.
|
|
814
|
+
*/
|
|
815
|
+
get: async (params) => connection.sendRequest("session.factory.journal.get", { sessionId, ...params }),
|
|
816
|
+
/**
|
|
817
|
+
* Stores a memoized factory journal entry.
|
|
818
|
+
*
|
|
819
|
+
* @param params Parameters for storing a factory journal entry.
|
|
820
|
+
*
|
|
821
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
822
|
+
*/
|
|
823
|
+
put: async (params) => connection.sendRequest("session.factory.journal.put", { sessionId, ...params })
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
/** @experimental */
|
|
765
827
|
model: {
|
|
766
828
|
/**
|
|
767
829
|
* Gets the currently selected model for the session.
|
|
@@ -1794,11 +1856,11 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1794
1856
|
*/
|
|
1795
1857
|
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { sessionId, ...params }),
|
|
1796
1858
|
/**
|
|
1797
|
-
* Records a working-directory/git context change and emits a `session.context_changed` event.
|
|
1859
|
+
* Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.
|
|
1798
1860
|
*
|
|
1799
1861
|
* @param params Updated working-directory/git context to record on the session.
|
|
1800
1862
|
*
|
|
1801
|
-
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode).
|
|
1863
|
+
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
1802
1864
|
*/
|
|
1803
1865
|
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { sessionId, ...params }),
|
|
1804
1866
|
/**
|
|
@@ -2068,6 +2130,16 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2068
2130
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
2069
2131
|
return handler.getToken(params);
|
|
2070
2132
|
});
|
|
2133
|
+
connection.onRequest("factory.execute", async (params) => {
|
|
2134
|
+
const handler = getHandlers(params.sessionId).factory;
|
|
2135
|
+
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2136
|
+
return handler.execute(params);
|
|
2137
|
+
});
|
|
2138
|
+
connection.onRequest("factory.abort", async (params) => {
|
|
2139
|
+
const handler = getHandlers(params.sessionId).factory;
|
|
2140
|
+
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2141
|
+
return handler.abort(params);
|
|
2142
|
+
});
|
|
2071
2143
|
connection.onRequest("sessionFs.readFile", async (params) => {
|
|
2072
2144
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
2073
2145
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
package/dist/generated/rpc.d.ts
CHANGED
|
@@ -484,6 +484,79 @@ export type ExternalToolTextResultForLlmContentResourceLinkIconTheme =
|
|
|
484
484
|
*/
|
|
485
485
|
/** @experimental */
|
|
486
486
|
export type ExternalToolTextResultForLlmContentResourceDetails = EmbeddedTextResourceContents | EmbeddedBlobResourceContents;
|
|
487
|
+
/**
|
|
488
|
+
* Kind of factory progress line.
|
|
489
|
+
*
|
|
490
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
491
|
+
* via the `definition` "FactoryLogLineKind".
|
|
492
|
+
*/
|
|
493
|
+
/** @experimental */
|
|
494
|
+
export type FactoryLogLineKind =
|
|
495
|
+
/** A narrator log line. */
|
|
496
|
+
"log"
|
|
497
|
+
/** A named factory phase marker. */
|
|
498
|
+
| "phase";
|
|
499
|
+
/**
|
|
500
|
+
* Machine-readable factory run failure.
|
|
501
|
+
*
|
|
502
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
503
|
+
* via the `definition` "FactoryRunFailure".
|
|
504
|
+
*/
|
|
505
|
+
/** @experimental */
|
|
506
|
+
export type FactoryRunFailure = {
|
|
507
|
+
kind: FactoryRunFailureKind;
|
|
508
|
+
/**
|
|
509
|
+
* Approved effective ceiling that was reached.
|
|
510
|
+
*/
|
|
511
|
+
value: number;
|
|
512
|
+
/**
|
|
513
|
+
* Factory run identifier.
|
|
514
|
+
*/
|
|
515
|
+
runId: string;
|
|
516
|
+
type: "factory_limit_reached";
|
|
517
|
+
} | {
|
|
518
|
+
/**
|
|
519
|
+
* Factory run identifier whose changed limits were declined.
|
|
520
|
+
*/
|
|
521
|
+
runId: string;
|
|
522
|
+
/**
|
|
523
|
+
* Human-readable reason the resume did not proceed.
|
|
524
|
+
*/
|
|
525
|
+
reason: string;
|
|
526
|
+
type: "factory_resume_declined";
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Cumulative resource ceiling that stopped a factory run.
|
|
530
|
+
*
|
|
531
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
532
|
+
* via the `definition` "FactoryRunFailureKind".
|
|
533
|
+
*/
|
|
534
|
+
/** @experimental */
|
|
535
|
+
export type FactoryRunFailureKind =
|
|
536
|
+
/** The run admitted the approved maximum total number of subagents. */
|
|
537
|
+
"maxTotalSubagents"
|
|
538
|
+
/** The run reached the approved timeout deadline. */
|
|
539
|
+
| "timeout";
|
|
540
|
+
/**
|
|
541
|
+
* Current or terminal state of a factory run.
|
|
542
|
+
*
|
|
543
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
544
|
+
* via the `definition` "FactoryRunStatus".
|
|
545
|
+
*/
|
|
546
|
+
/** @experimental */
|
|
547
|
+
export type FactoryRunStatus =
|
|
548
|
+
/** The run was minted and is awaiting approval. */
|
|
549
|
+
"pending"
|
|
550
|
+
/** The run is executing. */
|
|
551
|
+
| "running"
|
|
552
|
+
/** The run completed successfully. */
|
|
553
|
+
| "completed"
|
|
554
|
+
/** The run was interrupted while resource budget remained. */
|
|
555
|
+
| "halted"
|
|
556
|
+
/** The run was cancelled before completion. */
|
|
557
|
+
| "cancelled"
|
|
558
|
+
/** The factory body failed or reached a cumulative resource ceiling. */
|
|
559
|
+
| "error";
|
|
487
560
|
/**
|
|
488
561
|
* Content filtering mode to apply to all tools, or a map of tool name to content filtering mode.
|
|
489
562
|
*
|
|
@@ -4570,6 +4643,340 @@ export interface ExternalToolTextResultForLlmContentResource {
|
|
|
4570
4643
|
type: "resource";
|
|
4571
4644
|
resource: ExternalToolTextResultForLlmContentResourceDetails;
|
|
4572
4645
|
}
|
|
4646
|
+
/**
|
|
4647
|
+
* Parameters for cooperatively aborting a factory body.
|
|
4648
|
+
*
|
|
4649
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4650
|
+
* via the `definition` "FactoryAbortRequest".
|
|
4651
|
+
*/
|
|
4652
|
+
/** @experimental */
|
|
4653
|
+
export interface FactoryAbortRequest {
|
|
4654
|
+
/**
|
|
4655
|
+
* Target session identifier
|
|
4656
|
+
*/
|
|
4657
|
+
sessionId: string;
|
|
4658
|
+
/**
|
|
4659
|
+
* Factory run identifier.
|
|
4660
|
+
*/
|
|
4661
|
+
runId: string;
|
|
4662
|
+
}
|
|
4663
|
+
/**
|
|
4664
|
+
* Acknowledgement that a factory request was accepted.
|
|
4665
|
+
*
|
|
4666
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4667
|
+
* via the `definition` "FactoryAckResult".
|
|
4668
|
+
*/
|
|
4669
|
+
/** @experimental */
|
|
4670
|
+
export interface FactoryAckResult {
|
|
4671
|
+
}
|
|
4672
|
+
/**
|
|
4673
|
+
* Options for one factory-scoped subagent call.
|
|
4674
|
+
*
|
|
4675
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4676
|
+
* via the `definition` "FactoryAgentOptions".
|
|
4677
|
+
*/
|
|
4678
|
+
/** @experimental */
|
|
4679
|
+
export interface FactoryAgentOptions {
|
|
4680
|
+
/**
|
|
4681
|
+
* Optional label distinguishing otherwise identical memoized agent calls.
|
|
4682
|
+
*/
|
|
4683
|
+
label?: string;
|
|
4684
|
+
/**
|
|
4685
|
+
* Optional JSON Schema for structured agent output.
|
|
4686
|
+
*/
|
|
4687
|
+
schema?: {
|
|
4688
|
+
[k: string]: unknown | undefined;
|
|
4689
|
+
};
|
|
4690
|
+
/**
|
|
4691
|
+
* Optional model identifier for the subagent.
|
|
4692
|
+
*/
|
|
4693
|
+
model?: string;
|
|
4694
|
+
}
|
|
4695
|
+
/**
|
|
4696
|
+
* Parameters for one factory-scoped subagent call.
|
|
4697
|
+
*
|
|
4698
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4699
|
+
* via the `definition` "FactoryAgentRequest".
|
|
4700
|
+
*/
|
|
4701
|
+
/** @experimental */
|
|
4702
|
+
export interface FactoryAgentRequest {
|
|
4703
|
+
/**
|
|
4704
|
+
* Factory run identifier that owns the subagent.
|
|
4705
|
+
*/
|
|
4706
|
+
factoryRunId: string;
|
|
4707
|
+
/**
|
|
4708
|
+
* Prompt to send to the subagent.
|
|
4709
|
+
*/
|
|
4710
|
+
prompt: string;
|
|
4711
|
+
opts: FactoryAgentOptions;
|
|
4712
|
+
}
|
|
4713
|
+
/**
|
|
4714
|
+
* Result of one factory-scoped subagent call.
|
|
4715
|
+
*
|
|
4716
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4717
|
+
* via the `definition` "FactoryAgentResult".
|
|
4718
|
+
*/
|
|
4719
|
+
/** @experimental */
|
|
4720
|
+
export interface FactoryAgentResult {
|
|
4721
|
+
/**
|
|
4722
|
+
* Agent result, omitted when the agent produced no result.
|
|
4723
|
+
*/
|
|
4724
|
+
result?: {
|
|
4725
|
+
[k: string]: unknown | undefined;
|
|
4726
|
+
};
|
|
4727
|
+
}
|
|
4728
|
+
/**
|
|
4729
|
+
* Parameters for cancelling a factory run.
|
|
4730
|
+
*
|
|
4731
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4732
|
+
* via the `definition` "FactoryCancelRequest".
|
|
4733
|
+
*/
|
|
4734
|
+
/** @experimental */
|
|
4735
|
+
export interface FactoryCancelRequest {
|
|
4736
|
+
/**
|
|
4737
|
+
* Factory run identifier.
|
|
4738
|
+
*/
|
|
4739
|
+
runId: string;
|
|
4740
|
+
}
|
|
4741
|
+
/**
|
|
4742
|
+
* Parameters sent to the owning extension to execute a factory closure.
|
|
4743
|
+
*
|
|
4744
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4745
|
+
* via the `definition` "FactoryExecuteRequest".
|
|
4746
|
+
*/
|
|
4747
|
+
/** @experimental */
|
|
4748
|
+
export interface FactoryExecuteRequest {
|
|
4749
|
+
/**
|
|
4750
|
+
* Target session identifier
|
|
4751
|
+
*/
|
|
4752
|
+
sessionId: string;
|
|
4753
|
+
/**
|
|
4754
|
+
* Registered factory name.
|
|
4755
|
+
*/
|
|
4756
|
+
name: string;
|
|
4757
|
+
/**
|
|
4758
|
+
* Factory run identifier.
|
|
4759
|
+
*/
|
|
4760
|
+
runId: string;
|
|
4761
|
+
/**
|
|
4762
|
+
* Factory input value.
|
|
4763
|
+
*/
|
|
4764
|
+
args: {
|
|
4765
|
+
[k: string]: unknown | undefined;
|
|
4766
|
+
};
|
|
4767
|
+
}
|
|
4768
|
+
/**
|
|
4769
|
+
* Result returned by an extension factory closure.
|
|
4770
|
+
*
|
|
4771
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4772
|
+
* via the `definition` "FactoryExecuteResult".
|
|
4773
|
+
*/
|
|
4774
|
+
/** @experimental */
|
|
4775
|
+
export interface FactoryExecuteResult {
|
|
4776
|
+
/**
|
|
4777
|
+
* Factory result value.
|
|
4778
|
+
*/
|
|
4779
|
+
result: {
|
|
4780
|
+
[k: string]: unknown | undefined;
|
|
4781
|
+
};
|
|
4782
|
+
}
|
|
4783
|
+
/**
|
|
4784
|
+
* Parameters for retrieving a factory run.
|
|
4785
|
+
*
|
|
4786
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4787
|
+
* via the `definition` "FactoryGetRunRequest".
|
|
4788
|
+
*/
|
|
4789
|
+
/** @experimental */
|
|
4790
|
+
export interface FactoryGetRunRequest {
|
|
4791
|
+
/**
|
|
4792
|
+
* Factory run identifier.
|
|
4793
|
+
*/
|
|
4794
|
+
runId: string;
|
|
4795
|
+
}
|
|
4796
|
+
/**
|
|
4797
|
+
* Parameters for reading a factory journal entry.
|
|
4798
|
+
*
|
|
4799
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4800
|
+
* via the `definition` "FactoryJournalGetRequest".
|
|
4801
|
+
*/
|
|
4802
|
+
/** @experimental */
|
|
4803
|
+
export interface FactoryJournalGetRequest {
|
|
4804
|
+
/**
|
|
4805
|
+
* Factory run identifier.
|
|
4806
|
+
*/
|
|
4807
|
+
runId: string;
|
|
4808
|
+
/**
|
|
4809
|
+
* Namespaced journal key.
|
|
4810
|
+
*/
|
|
4811
|
+
key: string;
|
|
4812
|
+
}
|
|
4813
|
+
/**
|
|
4814
|
+
* Result of reading a factory journal entry.
|
|
4815
|
+
*
|
|
4816
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4817
|
+
* via the `definition` "FactoryJournalGetResult".
|
|
4818
|
+
*/
|
|
4819
|
+
/** @experimental */
|
|
4820
|
+
export interface FactoryJournalGetResult {
|
|
4821
|
+
/**
|
|
4822
|
+
* Whether the journal contained the requested key.
|
|
4823
|
+
*/
|
|
4824
|
+
hit: boolean;
|
|
4825
|
+
/**
|
|
4826
|
+
* Cached JSON result. The hit field distinguishes a cached JSON null from a miss.
|
|
4827
|
+
*/
|
|
4828
|
+
resultJson?: {
|
|
4829
|
+
[k: string]: unknown | undefined;
|
|
4830
|
+
};
|
|
4831
|
+
}
|
|
4832
|
+
/**
|
|
4833
|
+
* Parameters for storing a factory journal entry.
|
|
4834
|
+
*
|
|
4835
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4836
|
+
* via the `definition` "FactoryJournalPutRequest".
|
|
4837
|
+
*/
|
|
4838
|
+
/** @experimental */
|
|
4839
|
+
export interface FactoryJournalPutRequest {
|
|
4840
|
+
/**
|
|
4841
|
+
* Factory run identifier.
|
|
4842
|
+
*/
|
|
4843
|
+
runId: string;
|
|
4844
|
+
/**
|
|
4845
|
+
* Namespaced journal key.
|
|
4846
|
+
*/
|
|
4847
|
+
key: string;
|
|
4848
|
+
/**
|
|
4849
|
+
* JSON result to memoize.
|
|
4850
|
+
*/
|
|
4851
|
+
resultJson: {
|
|
4852
|
+
[k: string]: unknown | undefined;
|
|
4853
|
+
};
|
|
4854
|
+
}
|
|
4855
|
+
/**
|
|
4856
|
+
* One ordered factory progress line.
|
|
4857
|
+
*
|
|
4858
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4859
|
+
* via the `definition` "FactoryLogLine".
|
|
4860
|
+
*/
|
|
4861
|
+
/** @experimental */
|
|
4862
|
+
export interface FactoryLogLine {
|
|
4863
|
+
/**
|
|
4864
|
+
* Monotonic sequence number within the factory run.
|
|
4865
|
+
*/
|
|
4866
|
+
seq: number;
|
|
4867
|
+
kind: FactoryLogLineKind;
|
|
4868
|
+
/**
|
|
4869
|
+
* Progress text.
|
|
4870
|
+
*/
|
|
4871
|
+
text: string;
|
|
4872
|
+
}
|
|
4873
|
+
/**
|
|
4874
|
+
* Parameters for recording factory progress.
|
|
4875
|
+
*
|
|
4876
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4877
|
+
* via the `definition` "FactoryLogRequest".
|
|
4878
|
+
*/
|
|
4879
|
+
/** @experimental */
|
|
4880
|
+
export interface FactoryLogRequest {
|
|
4881
|
+
/**
|
|
4882
|
+
* Factory run identifier.
|
|
4883
|
+
*/
|
|
4884
|
+
runId: string;
|
|
4885
|
+
/**
|
|
4886
|
+
* Ordered progress lines to append.
|
|
4887
|
+
*/
|
|
4888
|
+
lines: FactoryLogLine[];
|
|
4889
|
+
}
|
|
4890
|
+
/**
|
|
4891
|
+
* Wire-only per-invocation factory resource ceiling overrides.
|
|
4892
|
+
*
|
|
4893
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4894
|
+
* via the `definition` "FactoryRunLimits".
|
|
4895
|
+
*/
|
|
4896
|
+
/** @experimental */
|
|
4897
|
+
export interface FactoryRunLimits {
|
|
4898
|
+
/**
|
|
4899
|
+
* Maximum number of factory subagents that may run concurrently.
|
|
4900
|
+
*/
|
|
4901
|
+
maxConcurrentSubagents?: number;
|
|
4902
|
+
/**
|
|
4903
|
+
* Maximum total number of factory subagents that may be admitted.
|
|
4904
|
+
*/
|
|
4905
|
+
maxTotalSubagents?: number;
|
|
4906
|
+
/**
|
|
4907
|
+
* Factory active-run timeout in milliseconds.
|
|
4908
|
+
*/
|
|
4909
|
+
timeout?: number;
|
|
4910
|
+
}
|
|
4911
|
+
/**
|
|
4912
|
+
* Parameters for invoking a registered factory.
|
|
4913
|
+
*
|
|
4914
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4915
|
+
* via the `definition` "FactoryRunRequest".
|
|
4916
|
+
*/
|
|
4917
|
+
/** @experimental */
|
|
4918
|
+
export interface FactoryRunRequest {
|
|
4919
|
+
/**
|
|
4920
|
+
* Registered factory name.
|
|
4921
|
+
*/
|
|
4922
|
+
name: string;
|
|
4923
|
+
/**
|
|
4924
|
+
* Factory input value.
|
|
4925
|
+
*/
|
|
4926
|
+
args: {
|
|
4927
|
+
[k: string]: unknown | undefined;
|
|
4928
|
+
};
|
|
4929
|
+
options?: RunOptions;
|
|
4930
|
+
}
|
|
4931
|
+
/**
|
|
4932
|
+
* Options controlling factory invocation.
|
|
4933
|
+
*
|
|
4934
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4935
|
+
* via the `definition` "RunOptions".
|
|
4936
|
+
*/
|
|
4937
|
+
/** @experimental */
|
|
4938
|
+
export interface RunOptions {
|
|
4939
|
+
limits?: FactoryRunLimits;
|
|
4940
|
+
/**
|
|
4941
|
+
* Run identifier whose journal and progress should seed this resumed run.
|
|
4942
|
+
*/
|
|
4943
|
+
resumeFromRunId?: string;
|
|
4944
|
+
}
|
|
4945
|
+
/**
|
|
4946
|
+
* Complete current or terminal factory run envelope.
|
|
4947
|
+
*
|
|
4948
|
+
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
4949
|
+
* via the `definition` "FactoryRunResult".
|
|
4950
|
+
*/
|
|
4951
|
+
/** @experimental */
|
|
4952
|
+
export interface FactoryRunResult {
|
|
4953
|
+
/**
|
|
4954
|
+
* Factory run identifier.
|
|
4955
|
+
*/
|
|
4956
|
+
runId: string;
|
|
4957
|
+
status: FactoryRunStatus;
|
|
4958
|
+
/**
|
|
4959
|
+
* Completed factory result.
|
|
4960
|
+
*/
|
|
4961
|
+
result?: {
|
|
4962
|
+
[k: string]: unknown | undefined;
|
|
4963
|
+
};
|
|
4964
|
+
/**
|
|
4965
|
+
* Error message for an errored run.
|
|
4966
|
+
*/
|
|
4967
|
+
error?: string;
|
|
4968
|
+
failure?: FactoryRunFailure;
|
|
4969
|
+
/**
|
|
4970
|
+
* Reason for a halted or cancelled run.
|
|
4971
|
+
*/
|
|
4972
|
+
reason?: string;
|
|
4973
|
+
/**
|
|
4974
|
+
* Partial journal and progress snapshot for a halted, cancelled, or errored run.
|
|
4975
|
+
*/
|
|
4976
|
+
snapshot?: {
|
|
4977
|
+
[k: string]: unknown | undefined;
|
|
4978
|
+
};
|
|
4979
|
+
}
|
|
4573
4980
|
/**
|
|
4574
4981
|
* Optional user prompt to combine with the fleet orchestration instructions.
|
|
4575
4982
|
*
|
|
@@ -5236,13 +5643,17 @@ export interface LlmInferenceHttpRequestStartRequest {
|
|
|
5236
5643
|
headers: LlmInferenceHeaders;
|
|
5237
5644
|
transport?: LlmInferenceHttpRequestStartTransport;
|
|
5238
5645
|
/**
|
|
5239
|
-
* Stable
|
|
5646
|
+
* Stable identity of the agent trajectory that issued this request. Present when the request originates from an agent turn; absent for requests outside any agent context. This is the same identity used by lifecycle and bridged session events and remains constant across turns and retries.
|
|
5240
5647
|
*/
|
|
5241
5648
|
agentId?: string;
|
|
5242
5649
|
/**
|
|
5243
|
-
*
|
|
5650
|
+
* Stable identity of the immediate parent trajectory. Present for child trajectories such as subagents and conversation-sampling requests; absent for root-agent and non-agent requests.
|
|
5244
5651
|
*/
|
|
5245
5652
|
parentAgentId?: string;
|
|
5653
|
+
/**
|
|
5654
|
+
* Identity of the agent invocation (one agentic loop) that issued this request. It remains fixed across physical retries within the invocation and is distinct from the stable trajectory `agentId`. A caller-supplied invocation id always takes precedence (this covers auxiliary calls that have no model call id). Otherwise, first-party CAPI requests fall back to the runtime's agent task id — the same value the runtime emits as the `X-Agent-Task-Id` header — while custom-provider requests fall back to the model call id.
|
|
5655
|
+
*/
|
|
5656
|
+
agentInvocationId?: string;
|
|
5246
5657
|
/**
|
|
5247
5658
|
* Coarse classification of the interaction that produced this request. Open string for forward-compatibility; known values include `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, and `conversation-user`. Absent when the runtime did not classify the request. Comes from the runtime's per-request agent context independently of transport; on the CAPI transport the runtime derives the upstream `X-Interaction-Type` header from this same context.
|
|
5248
5659
|
*/
|
|
@@ -7132,7 +7543,7 @@ export interface SessionWorkingDirectoryContext {
|
|
|
7132
7543
|
baseCommit?: string;
|
|
7133
7544
|
}
|
|
7134
7545
|
/**
|
|
7135
|
-
* Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode).
|
|
7546
|
+
* Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
7136
7547
|
*
|
|
7137
7548
|
* This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema
|
|
7138
7549
|
* via the `definition` "MetadataRecordContextChangeResult".
|
|
@@ -10627,6 +11038,14 @@ export interface SandboxConfig {
|
|
|
10627
11038
|
* Whether to auto-add the current working directory to readwritePaths. Default: true.
|
|
10628
11039
|
*/
|
|
10629
11040
|
addCurrentWorkingDirectory?: boolean;
|
|
11041
|
+
/**
|
|
11042
|
+
* Whether to inject the Copilot GitHub token as an `http.<host>.extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. Default: false (opt-in).
|
|
11043
|
+
*/
|
|
11044
|
+
gitAuth?: boolean;
|
|
11045
|
+
/**
|
|
11046
|
+
* Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in).
|
|
11047
|
+
*/
|
|
11048
|
+
ghAuth?: boolean;
|
|
10630
11049
|
}
|
|
10631
11050
|
/**
|
|
10632
11051
|
* User-managed sandbox policy fragment merged into the auto-discovered base policy.
|
|
@@ -11064,6 +11483,10 @@ export interface ServerSkillList {
|
|
|
11064
11483
|
* All discovered skills across all sources
|
|
11065
11484
|
*/
|
|
11066
11485
|
skills: ServerSkill[];
|
|
11486
|
+
/**
|
|
11487
|
+
* Messages for skills that failed to load (e.g. malformed SKILL.md). Empty when host skills are excluded so host-local paths are not disclosed to multitenant callers.
|
|
11488
|
+
*/
|
|
11489
|
+
errors?: string[];
|
|
11067
11490
|
}
|
|
11068
11491
|
/**
|
|
11069
11492
|
* Current activity flags for the session.
|
|
@@ -14844,6 +15267,10 @@ export interface UsageMetricsCodeChanges {
|
|
|
14844
15267
|
export interface UsageMetricsModelMetric {
|
|
14845
15268
|
requests: UsageMetricsModelMetricRequests;
|
|
14846
15269
|
usage: UsageMetricsModelMetricUsage;
|
|
15270
|
+
/**
|
|
15271
|
+
* Latest known prompt-cache expiration for this model. A timestamp in the past indicates that the observed cache has expired.
|
|
15272
|
+
*/
|
|
15273
|
+
cacheExpiresAt?: string;
|
|
14847
15274
|
/**
|
|
14848
15275
|
* Accumulated nano-AI units cost for this model
|
|
14849
15276
|
*/
|
|
@@ -16013,6 +16440,68 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
|
|
|
16013
16440
|
};
|
|
16014
16441
|
};
|
|
16015
16442
|
/** @experimental */
|
|
16443
|
+
factory: {
|
|
16444
|
+
/**
|
|
16445
|
+
* Runs a registered factory by name at the top level.
|
|
16446
|
+
*
|
|
16447
|
+
* @param params Parameters for invoking a registered factory.
|
|
16448
|
+
*
|
|
16449
|
+
* @returns Complete current or terminal factory run envelope.
|
|
16450
|
+
*/
|
|
16451
|
+
run: (params: FactoryRunRequest) => Promise<FactoryRunResult>;
|
|
16452
|
+
/**
|
|
16453
|
+
* Gets the current or settled envelope for a factory run.
|
|
16454
|
+
*
|
|
16455
|
+
* @param params Parameters for retrieving a factory run.
|
|
16456
|
+
*
|
|
16457
|
+
* @returns Complete current or terminal factory run envelope.
|
|
16458
|
+
*/
|
|
16459
|
+
getRun: (params: FactoryGetRunRequest) => Promise<FactoryRunResult>;
|
|
16460
|
+
/**
|
|
16461
|
+
* Requests cancellation of a factory run and returns its run envelope.
|
|
16462
|
+
*
|
|
16463
|
+
* @param params Parameters for cancelling a factory run.
|
|
16464
|
+
*
|
|
16465
|
+
* @returns Complete current or terminal factory run envelope.
|
|
16466
|
+
*/
|
|
16467
|
+
cancel: (params: FactoryCancelRequest) => Promise<FactoryRunResult>;
|
|
16468
|
+
/**
|
|
16469
|
+
* Records a batch of ordered factory progress lines.
|
|
16470
|
+
*
|
|
16471
|
+
* @param params Parameters for recording factory progress.
|
|
16472
|
+
*
|
|
16473
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
16474
|
+
*/
|
|
16475
|
+
log: (params: FactoryLogRequest) => Promise<FactoryAckResult>;
|
|
16476
|
+
/**
|
|
16477
|
+
* Runs one factory-scoped subagent and returns its result.
|
|
16478
|
+
*
|
|
16479
|
+
* @param params Parameters for one factory-scoped subagent call.
|
|
16480
|
+
*
|
|
16481
|
+
* @returns Result of one factory-scoped subagent call.
|
|
16482
|
+
*/
|
|
16483
|
+
agent: (params: FactoryAgentRequest) => Promise<FactoryAgentResult>;
|
|
16484
|
+
/** @experimental */
|
|
16485
|
+
journal: {
|
|
16486
|
+
/**
|
|
16487
|
+
* Reads a memoized factory journal entry.
|
|
16488
|
+
*
|
|
16489
|
+
* @param params Parameters for reading a factory journal entry.
|
|
16490
|
+
*
|
|
16491
|
+
* @returns Result of reading a factory journal entry.
|
|
16492
|
+
*/
|
|
16493
|
+
get: (params: FactoryJournalGetRequest) => Promise<FactoryJournalGetResult>;
|
|
16494
|
+
/**
|
|
16495
|
+
* Stores a memoized factory journal entry.
|
|
16496
|
+
*
|
|
16497
|
+
* @param params Parameters for storing a factory journal entry.
|
|
16498
|
+
*
|
|
16499
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
16500
|
+
*/
|
|
16501
|
+
put: (params: FactoryJournalPutRequest) => Promise<FactoryAckResult>;
|
|
16502
|
+
};
|
|
16503
|
+
};
|
|
16504
|
+
/** @experimental */
|
|
16016
16505
|
model: {
|
|
16017
16506
|
/**
|
|
16018
16507
|
* Gets the currently selected model for the session.
|
|
@@ -17045,11 +17534,11 @@ export declare function createSessionRpc(connection: MessageConnection, sessionI
|
|
|
17045
17534
|
*/
|
|
17046
17535
|
getContextHeaviestMessages: (params: MetadataContextHeaviestMessagesRequest) => Promise<MetadataContextHeaviestMessagesResult>;
|
|
17047
17536
|
/**
|
|
17048
|
-
* Records a working-directory/git context change and emits a `session.context_changed` event.
|
|
17537
|
+
* Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.
|
|
17049
17538
|
*
|
|
17050
17539
|
* @param params Updated working-directory/git context to record on the session.
|
|
17051
17540
|
*
|
|
17052
|
-
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode).
|
|
17541
|
+
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
17053
17542
|
*/
|
|
17054
17543
|
recordContextChange: (params: MetadataRecordContextChangeRequest) => Promise<MetadataRecordContextChangeResult>;
|
|
17055
17544
|
/**
|
|
@@ -17272,6 +17761,26 @@ export interface ProviderTokenHandler {
|
|
|
17272
17761
|
*/
|
|
17273
17762
|
getToken(params: ProviderTokenAcquireRequest): Promise<ProviderTokenAcquireResult>;
|
|
17274
17763
|
}
|
|
17764
|
+
/** Handler for `factory` client session API methods. */
|
|
17765
|
+
/** @experimental */
|
|
17766
|
+
export interface FactoryHandler {
|
|
17767
|
+
/**
|
|
17768
|
+
* Asks the owning extension connection to execute a registered factory closure.
|
|
17769
|
+
*
|
|
17770
|
+
* @param params Parameters sent to the owning extension to execute a factory closure.
|
|
17771
|
+
*
|
|
17772
|
+
* @returns Result returned by an extension factory closure.
|
|
17773
|
+
*/
|
|
17774
|
+
execute(params: FactoryExecuteRequest): Promise<FactoryExecuteResult>;
|
|
17775
|
+
/**
|
|
17776
|
+
* Asks the owning extension connection to abort a running factory cooperatively.
|
|
17777
|
+
*
|
|
17778
|
+
* @param params Parameters for cooperatively aborting a factory body.
|
|
17779
|
+
*
|
|
17780
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
17781
|
+
*/
|
|
17782
|
+
abort(params: FactoryAbortRequest): Promise<FactoryAckResult>;
|
|
17783
|
+
}
|
|
17275
17784
|
/** Handler for `sessionFs` client session API methods. */
|
|
17276
17785
|
/** @experimental */
|
|
17277
17786
|
export interface SessionFsHandler {
|
|
@@ -17401,6 +17910,7 @@ export interface CanvasHandler {
|
|
|
17401
17910
|
/** All client session API handler groups. */
|
|
17402
17911
|
export interface ClientSessionApiHandlers {
|
|
17403
17912
|
providerToken?: ProviderTokenHandler;
|
|
17913
|
+
factory?: FactoryHandler;
|
|
17404
17914
|
sessionFs?: SessionFsHandler;
|
|
17405
17915
|
canvas?: CanvasHandler;
|
|
17406
17916
|
}
|
package/dist/generated/rpc.js
CHANGED
|
@@ -734,6 +734,68 @@ function createSessionRpc(connection, sessionId) {
|
|
|
734
734
|
}
|
|
735
735
|
},
|
|
736
736
|
/** @experimental */
|
|
737
|
+
factory: {
|
|
738
|
+
/**
|
|
739
|
+
* Runs a registered factory by name at the top level.
|
|
740
|
+
*
|
|
741
|
+
* @param params Parameters for invoking a registered factory.
|
|
742
|
+
*
|
|
743
|
+
* @returns Complete current or terminal factory run envelope.
|
|
744
|
+
*/
|
|
745
|
+
run: async (params) => connection.sendRequest("session.factory.run", { sessionId, ...params }),
|
|
746
|
+
/**
|
|
747
|
+
* Gets the current or settled envelope for a factory run.
|
|
748
|
+
*
|
|
749
|
+
* @param params Parameters for retrieving a factory run.
|
|
750
|
+
*
|
|
751
|
+
* @returns Complete current or terminal factory run envelope.
|
|
752
|
+
*/
|
|
753
|
+
getRun: async (params) => connection.sendRequest("session.factory.getRun", { sessionId, ...params }),
|
|
754
|
+
/**
|
|
755
|
+
* Requests cancellation of a factory run and returns its run envelope.
|
|
756
|
+
*
|
|
757
|
+
* @param params Parameters for cancelling a factory run.
|
|
758
|
+
*
|
|
759
|
+
* @returns Complete current or terminal factory run envelope.
|
|
760
|
+
*/
|
|
761
|
+
cancel: async (params) => connection.sendRequest("session.factory.cancel", { sessionId, ...params }),
|
|
762
|
+
/**
|
|
763
|
+
* Records a batch of ordered factory progress lines.
|
|
764
|
+
*
|
|
765
|
+
* @param params Parameters for recording factory progress.
|
|
766
|
+
*
|
|
767
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
768
|
+
*/
|
|
769
|
+
log: async (params) => connection.sendRequest("session.factory.log", { sessionId, ...params }),
|
|
770
|
+
/**
|
|
771
|
+
* Runs one factory-scoped subagent and returns its result.
|
|
772
|
+
*
|
|
773
|
+
* @param params Parameters for one factory-scoped subagent call.
|
|
774
|
+
*
|
|
775
|
+
* @returns Result of one factory-scoped subagent call.
|
|
776
|
+
*/
|
|
777
|
+
agent: async (params) => connection.sendRequest("session.factory.agent", { sessionId, ...params }),
|
|
778
|
+
/** @experimental */
|
|
779
|
+
journal: {
|
|
780
|
+
/**
|
|
781
|
+
* Reads a memoized factory journal entry.
|
|
782
|
+
*
|
|
783
|
+
* @param params Parameters for reading a factory journal entry.
|
|
784
|
+
*
|
|
785
|
+
* @returns Result of reading a factory journal entry.
|
|
786
|
+
*/
|
|
787
|
+
get: async (params) => connection.sendRequest("session.factory.journal.get", { sessionId, ...params }),
|
|
788
|
+
/**
|
|
789
|
+
* Stores a memoized factory journal entry.
|
|
790
|
+
*
|
|
791
|
+
* @param params Parameters for storing a factory journal entry.
|
|
792
|
+
*
|
|
793
|
+
* @returns Acknowledgement that a factory request was accepted.
|
|
794
|
+
*/
|
|
795
|
+
put: async (params) => connection.sendRequest("session.factory.journal.put", { sessionId, ...params })
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
/** @experimental */
|
|
737
799
|
model: {
|
|
738
800
|
/**
|
|
739
801
|
* Gets the currently selected model for the session.
|
|
@@ -1766,11 +1828,11 @@ function createSessionRpc(connection, sessionId) {
|
|
|
1766
1828
|
*/
|
|
1767
1829
|
getContextHeaviestMessages: async (params) => connection.sendRequest("session.metadata.getContextHeaviestMessages", { sessionId, ...params }),
|
|
1768
1830
|
/**
|
|
1769
|
-
* Records a working-directory/git context change and emits a `session.context_changed` event.
|
|
1831
|
+
* Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.
|
|
1770
1832
|
*
|
|
1771
1833
|
* @param params Updated working-directory/git context to record on the session.
|
|
1772
1834
|
*
|
|
1773
|
-
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode).
|
|
1835
|
+
* @returns Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.
|
|
1774
1836
|
*/
|
|
1775
1837
|
recordContextChange: async (params) => connection.sendRequest("session.metadata.recordContextChange", { sessionId, ...params }),
|
|
1776
1838
|
/**
|
|
@@ -2040,6 +2102,16 @@ function registerClientSessionApiHandlers(connection, getHandlers) {
|
|
|
2040
2102
|
if (!handler) throw new Error(`No providerToken handler registered for session: ${params.sessionId}`);
|
|
2041
2103
|
return handler.getToken(params);
|
|
2042
2104
|
});
|
|
2105
|
+
connection.onRequest("factory.execute", async (params) => {
|
|
2106
|
+
const handler = getHandlers(params.sessionId).factory;
|
|
2107
|
+
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2108
|
+
return handler.execute(params);
|
|
2109
|
+
});
|
|
2110
|
+
connection.onRequest("factory.abort", async (params) => {
|
|
2111
|
+
const handler = getHandlers(params.sessionId).factory;
|
|
2112
|
+
if (!handler) throw new Error(`No factory handler registered for session: ${params.sessionId}`);
|
|
2113
|
+
return handler.abort(params);
|
|
2114
|
+
});
|
|
2043
2115
|
connection.onRequest("sessionFs.readFile", async (params) => {
|
|
2044
2116
|
const handler = getHandlers(params.sessionId).sessionFs;
|
|
2045
2117
|
if (!handler) throw new Error(`No sessionFs handler registered for session: ${params.sessionId}`);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Union of all session event variants emitted by the Copilot CLI runtime.
|
|
7
7
|
*/
|
|
8
|
-
export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantIntentEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
|
|
8
|
+
export type SessionEvent = StartEvent | ResumeEvent | RemoteSteerableChangedEvent | ErrorEvent | IdleEvent | TitleChangedEvent | ScheduleCreatedEvent | ScheduleCancelledEvent | ScheduleRearmedEvent | AutopilotObjectiveChangedEvent | InfoEvent | WarningEvent | ModelChangeEvent | ModeChangedEvent | SessionLimitsChangedEvent | PermissionsChangedEvent | PlanChangedEvent | TodosChangedEvent | WorkspaceFileChangedEvent | HandoffEvent | TruncationEvent | SnapshotRewindEvent | ShutdownEvent | UsageCheckpointEvent | ContextChangedEvent | UsageInfoEvent | CompactionStartEvent | CompactionCompleteEvent | TaskCompleteEvent | UserMessageEvent | PendingMessagesModifiedEvent | AssistantTurnStartEvent | AssistantTurnRetryEvent | AssistantIntentEvent | AssistantServerToolProgressEvent | AssistantReasoningEvent | AssistantReasoningDeltaEvent | AssistantToolCallDeltaEvent | AssistantStreamingDeltaEvent | AssistantMessageEvent | AssistantMessageStartEvent | AssistantMessageDeltaEvent | AssistantTurnEndEvent | AssistantIdleEvent | AssistantUsageEvent | ModelCallFailureEvent | ModelCallStartEvent | AbortEvent | ToolUserRequestedEvent | ToolExecutionStartEvent | ToolExecutionPartialResultEvent | ToolExecutionProgressEvent | ToolExecutionCompleteEvent | ToolSearchActivatedEvent | SkillInvokedEvent | SubagentStartedEvent | SubagentCompletedEvent | SubagentFailedEvent | SubagentSelectedEvent | SubagentDeselectedEvent | HookStartEvent | HookEndEvent | HookProgressEvent | BinaryAssetEvent | SystemMessageEvent | SystemNotificationEvent | PermissionRequestedEvent | PermissionCompletedEvent | UserInputRequestedEvent | UserInputCompletedEvent | ElicitationRequestedEvent | ElicitationCompletedEvent | SamplingRequestedEvent | SamplingCompletedEvent | McpOauthRequiredEvent | McpOauthCompletedEvent | McpHeadersRefreshRequiredEvent | McpHeadersRefreshCompletedEvent | CustomNotificationEvent | ExternalToolRequestedEvent | ExternalToolCompletedEvent | CommandQueuedEvent | CommandExecuteEvent | CommandCompletedEvent | AutoModeSwitchRequestedEvent | AutoModeSwitchCompletedEvent | SessionLimitsExhaustedRequestedEvent | SessionLimitsExhaustedCompletedEvent | AutoModeResolvedEvent | ManagedSettingsResolvedEvent | ManagedSettingsEnforcedEvent | CommandsChangedEvent | CapabilitiesChangedEvent | ExitPlanModeRequestedEvent | ExitPlanModeCompletedEvent | ToolsUpdatedEvent | BackgroundTasksChangedEvent | SkillsLoadedEvent | CustomAgentsUpdatedEvent | McpServersLoadedEvent | McpServerStatusChangedEvent | McpToolsListChangedEvent | McpResourcesListChangedEvent | McpPromptsListChangedEvent | ExtensionsLoadedEvent | CanvasOpenedEvent | CanvasRegistryChangedEvent | CanvasClosedEvent | CanvasUnavailableEvent | CanvasRecordedEvent | CanvasRemovedEvent | ExtensionsAttachmentsPushedEvent | McpAppToolCallCompleteEvent;
|
|
9
9
|
/**
|
|
10
10
|
* Hosting platform type of the repository (github or ado)
|
|
11
11
|
*/
|
|
@@ -207,6 +207,14 @@ export type ModelCallFailureBadRequestKind =
|
|
|
207
207
|
"bodyless"
|
|
208
208
|
/** The 400 response carried a structured CAPI error envelope (deterministic validation failure). */
|
|
209
209
|
| "structured_error";
|
|
210
|
+
/**
|
|
211
|
+
* Boundary that produced a model call failure
|
|
212
|
+
*/
|
|
213
|
+
export type ModelCallFailureKind =
|
|
214
|
+
/** The provider returned an API error response. */
|
|
215
|
+
"api"
|
|
216
|
+
/** The request transport failed before a usable API response completed. */
|
|
217
|
+
| "transport";
|
|
210
218
|
/**
|
|
211
219
|
* Where the failed model call originated
|
|
212
220
|
*/
|
|
@@ -217,6 +225,14 @@ export type ModelCallFailureSource =
|
|
|
217
225
|
| "subagent"
|
|
218
226
|
/** Model call from MCP sampling. */
|
|
219
227
|
| "mcp_sampling";
|
|
228
|
+
/**
|
|
229
|
+
* Transport used for a failed model call
|
|
230
|
+
*/
|
|
231
|
+
export type ModelCallFailureTransport =
|
|
232
|
+
/** HTTP transport, including SSE streams. */
|
|
233
|
+
"http"
|
|
234
|
+
/** WebSocket transport. */
|
|
235
|
+
| "websocket";
|
|
220
236
|
/**
|
|
221
237
|
* Finite reason code describing why the current turn was aborted
|
|
222
238
|
*/
|
|
@@ -481,6 +497,26 @@ export type ManagedSettingsResolvedSource =
|
|
|
481
497
|
| "device"
|
|
482
498
|
/** No managed policy is in force (no layer contributed). */
|
|
483
499
|
| "none";
|
|
500
|
+
/**
|
|
501
|
+
* The category of runtime action that enterprise managed settings governed (blocked or capped)
|
|
502
|
+
*/
|
|
503
|
+
export type ManagedSettingsEnforcedAction =
|
|
504
|
+
/** An attempt to turn on a bypass-permissions ("yolo") escalation was refused or capped because policy disables bypass-permissions mode. */
|
|
505
|
+
"bypass_permissions_blocked";
|
|
506
|
+
/**
|
|
507
|
+
* For a `bypass_permissions_blocked` action, which permission-escalation primitive was refused
|
|
508
|
+
*/
|
|
509
|
+
export type ManagedSettingsEnforcedEscalation =
|
|
510
|
+
/** Full allow-all ("/allow-all on") permissions — auto-approving tools, paths, and URLs. */
|
|
511
|
+
"allow_all"
|
|
512
|
+
/** Auto-approval of all tool permission requests. */
|
|
513
|
+
| "approve_all"
|
|
514
|
+
/** Advisory auto-approval ("/allow-all auto") mode — keeps normal prompt paths and adds LLM-advised approval, distinct from full allow-all. */
|
|
515
|
+
| "auto_approval"
|
|
516
|
+
/** Unrestricted filesystem access outside the session's allowed directories. */
|
|
517
|
+
| "unrestricted_paths"
|
|
518
|
+
/** Unrestricted URL fetch access. */
|
|
519
|
+
| "unrestricted_urls";
|
|
484
520
|
/**
|
|
485
521
|
* Exit plan mode action
|
|
486
522
|
*/
|
|
@@ -2914,6 +2950,23 @@ export interface AssistantTurnStartData {
|
|
|
2914
2950
|
*/
|
|
2915
2951
|
turnId: string;
|
|
2916
2952
|
}
|
|
2953
|
+
/**
|
|
2954
|
+
* Metadata for an additional model inference attempt within an existing assistant turn
|
|
2955
|
+
*/
|
|
2956
|
+
export interface AssistantTurnRetryData {
|
|
2957
|
+
/**
|
|
2958
|
+
* Model identifier used for this retry, when known
|
|
2959
|
+
*/
|
|
2960
|
+
model?: string;
|
|
2961
|
+
/**
|
|
2962
|
+
* Provider or runtime classification that caused the retry, when known
|
|
2963
|
+
*/
|
|
2964
|
+
reason?: string;
|
|
2965
|
+
/**
|
|
2966
|
+
* Identifier of the turn whose model inference is being retried
|
|
2967
|
+
*/
|
|
2968
|
+
turnId: string;
|
|
2969
|
+
}
|
|
2917
2970
|
/**
|
|
2918
2971
|
* Session event "assistant.intent". Agent intent description for current activity or plan
|
|
2919
2972
|
*/
|
|
@@ -3675,6 +3728,10 @@ export interface AssistantUsageData {
|
|
|
3675
3728
|
*/
|
|
3676
3729
|
apiCallId?: string;
|
|
3677
3730
|
apiEndpoint?: AssistantUsageApiEndpoint;
|
|
3731
|
+
/**
|
|
3732
|
+
* Updated prompt-cache expiration for this model call. Present only when the call establishes or refreshes known cache state.
|
|
3733
|
+
*/
|
|
3734
|
+
cacheExpiresAt?: string;
|
|
3678
3735
|
/**
|
|
3679
3736
|
* Number of tokens read from prompt cache
|
|
3680
3737
|
*/
|
|
@@ -3816,6 +3873,7 @@ export interface ModelCallFailureData {
|
|
|
3816
3873
|
* Completion ID from the model provider (e.g., chatcmpl-abc123)
|
|
3817
3874
|
*/
|
|
3818
3875
|
apiCallId?: string;
|
|
3876
|
+
apiEndpoint?: AssistantUsageApiEndpoint;
|
|
3819
3877
|
badRequestKind?: ModelCallFailureBadRequestKind;
|
|
3820
3878
|
/**
|
|
3821
3879
|
* Duration of the failed API call in milliseconds
|
|
@@ -3833,10 +3891,27 @@ export interface ModelCallFailureData {
|
|
|
3833
3891
|
* For HTTP 400 failures only: the `type` from the CAPI error envelope (e.g. 'websocket_error'), a coarser companion to errorCode for envelopes that carry no code. Raw server-controlled string, emitted only through restricted telemetry. Absent for bodyless or non-400 failures.
|
|
3834
3892
|
*/
|
|
3835
3893
|
errorType?: string;
|
|
3894
|
+
failureKind?: ModelCallFailureKind;
|
|
3836
3895
|
/**
|
|
3837
3896
|
* What initiated this API call (e.g., "sub-agent", "mcp-sampling"); absent for user-initiated calls
|
|
3838
3897
|
*/
|
|
3839
3898
|
initiator?: string;
|
|
3899
|
+
/**
|
|
3900
|
+
* Whether the session selected Auto mode for the failed call
|
|
3901
|
+
*/
|
|
3902
|
+
isAuto?: boolean;
|
|
3903
|
+
/**
|
|
3904
|
+
* Whether the failed call used a bring-your-own-key provider
|
|
3905
|
+
*/
|
|
3906
|
+
isByok?: boolean;
|
|
3907
|
+
/**
|
|
3908
|
+
* Effective maximum output-token limit for the failed call
|
|
3909
|
+
*/
|
|
3910
|
+
maxOutputTokens?: number;
|
|
3911
|
+
/**
|
|
3912
|
+
* Effective maximum prompt-token limit for the failed call
|
|
3913
|
+
*/
|
|
3914
|
+
maxPromptTokens?: number;
|
|
3840
3915
|
/**
|
|
3841
3916
|
* Model identifier used for the failed API call
|
|
3842
3917
|
*/
|
|
@@ -3845,6 +3920,10 @@ export interface ModelCallFailureData {
|
|
|
3845
3920
|
* GitHub request tracing ID (x-github-request-id header) for server-side log correlation
|
|
3846
3921
|
*/
|
|
3847
3922
|
providerCallId?: string;
|
|
3923
|
+
/**
|
|
3924
|
+
* Reasoning effort level used for the failed model call, if applicable
|
|
3925
|
+
*/
|
|
3926
|
+
reasoningEffort?: string;
|
|
3848
3927
|
requestFingerprint?: ModelCallFailureRequestFingerprint;
|
|
3849
3928
|
/**
|
|
3850
3929
|
* Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation
|
|
@@ -3855,6 +3934,7 @@ export interface ModelCallFailureData {
|
|
|
3855
3934
|
* HTTP status code from the failed request
|
|
3856
3935
|
*/
|
|
3857
3936
|
statusCode?: number;
|
|
3937
|
+
transport?: ModelCallFailureTransport;
|
|
3858
3938
|
}
|
|
3859
3939
|
/**
|
|
3860
3940
|
* Content-free structural summary of the failing request for diagnosing malformed 4xx calls
|
|
@@ -3889,6 +3969,19 @@ export interface ModelCallFailureRequestFingerprint {
|
|
|
3889
3969
|
*/
|
|
3890
3970
|
toolResultMessageCount: number;
|
|
3891
3971
|
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Model API dispatch metadata for internal telemetry
|
|
3974
|
+
*/
|
|
3975
|
+
export interface ModelCallStartData {
|
|
3976
|
+
/**
|
|
3977
|
+
* Model identifier used for this API call, when known
|
|
3978
|
+
*/
|
|
3979
|
+
model?: string;
|
|
3980
|
+
/**
|
|
3981
|
+
* Identifier of the assistant turn that initiated the model call
|
|
3982
|
+
*/
|
|
3983
|
+
turnId: string;
|
|
3984
|
+
}
|
|
3892
3985
|
/**
|
|
3893
3986
|
* Session event "abort". Turn abort information including the reason for termination
|
|
3894
3987
|
*/
|
|
@@ -4734,6 +4827,49 @@ export interface ToolExecutionCompleteToolDescriptionMetaUI {
|
|
|
4734
4827
|
*/
|
|
4735
4828
|
visibility?: ToolExecutionCompleteToolDescriptionMetaUIVisibility[];
|
|
4736
4829
|
}
|
|
4830
|
+
/**
|
|
4831
|
+
* Session event "tool_search.activated". Persisted generic client-side tool activations restored when a session resumes.
|
|
4832
|
+
*/
|
|
4833
|
+
export interface ToolSearchActivatedEvent {
|
|
4834
|
+
/**
|
|
4835
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
4836
|
+
*/
|
|
4837
|
+
agentId?: string;
|
|
4838
|
+
data: ToolSearchActivatedData;
|
|
4839
|
+
/**
|
|
4840
|
+
* When true, the event is transient and not persisted to the session event log on disk
|
|
4841
|
+
*/
|
|
4842
|
+
ephemeral?: boolean;
|
|
4843
|
+
/**
|
|
4844
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
4845
|
+
*/
|
|
4846
|
+
id: string;
|
|
4847
|
+
/**
|
|
4848
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
4849
|
+
*/
|
|
4850
|
+
parentId: string | null;
|
|
4851
|
+
/**
|
|
4852
|
+
* ISO 8601 timestamp when the event was created
|
|
4853
|
+
*/
|
|
4854
|
+
timestamp: string;
|
|
4855
|
+
/**
|
|
4856
|
+
* Type discriminator. Always "tool_search.activated".
|
|
4857
|
+
*/
|
|
4858
|
+
type: "tool_search.activated";
|
|
4859
|
+
}
|
|
4860
|
+
/**
|
|
4861
|
+
* Persisted generic client-side tool activations restored when a session resumes.
|
|
4862
|
+
*/
|
|
4863
|
+
export interface ToolSearchActivatedData {
|
|
4864
|
+
/**
|
|
4865
|
+
* Tool-search strategy that activated the definitions.
|
|
4866
|
+
*/
|
|
4867
|
+
strategy: string;
|
|
4868
|
+
/**
|
|
4869
|
+
* Names of tool definitions activated by this search invocation.
|
|
4870
|
+
*/
|
|
4871
|
+
toolNames: string[];
|
|
4872
|
+
}
|
|
4737
4873
|
/**
|
|
4738
4874
|
* Session event "skill.invoked". Skill invocation details including content, allowed tools, and plugin metadata
|
|
4739
4875
|
*/
|
|
@@ -7739,6 +7875,57 @@ export interface ManagedSettingsResolvedData {
|
|
|
7739
7875
|
};
|
|
7740
7876
|
source: ManagedSettingsResolvedSource;
|
|
7741
7877
|
}
|
|
7878
|
+
/**
|
|
7879
|
+
* Session event "session.managed_settings_enforced". Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes.
|
|
7880
|
+
*/
|
|
7881
|
+
/** @experimental */
|
|
7882
|
+
export interface ManagedSettingsEnforcedEvent {
|
|
7883
|
+
/**
|
|
7884
|
+
* Sub-agent instance identifier. Absent for events from the root/main agent and session-level events.
|
|
7885
|
+
*/
|
|
7886
|
+
agentId?: string;
|
|
7887
|
+
data: ManagedSettingsEnforcedData;
|
|
7888
|
+
/**
|
|
7889
|
+
* Always true for events that are transient and not persisted to the session event log on disk.
|
|
7890
|
+
*/
|
|
7891
|
+
ephemeral: true;
|
|
7892
|
+
/**
|
|
7893
|
+
* Unique event identifier (UUID v4), generated when the event is emitted
|
|
7894
|
+
*/
|
|
7895
|
+
id: string;
|
|
7896
|
+
/**
|
|
7897
|
+
* ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event.
|
|
7898
|
+
*/
|
|
7899
|
+
parentId: string | null;
|
|
7900
|
+
/**
|
|
7901
|
+
* ISO 8601 timestamp when the event was created
|
|
7902
|
+
*/
|
|
7903
|
+
timestamp: string;
|
|
7904
|
+
/**
|
|
7905
|
+
* Type discriminator. Always "session.managed_settings_enforced".
|
|
7906
|
+
*/
|
|
7907
|
+
type: "session.managed_settings_enforced";
|
|
7908
|
+
}
|
|
7909
|
+
/**
|
|
7910
|
+
* Runtime enforcement of enterprise managed settings: fires when the session blocks or caps a runtime action because enterprise policy governs it, so SDK clients can explain *why* an action was governed. Unlike `session.managed_settings_resolved` (which reports *what* is managed), this reports a concrete governed action — e.g. a user or host tried to turn on a bypass-permissions escalation while policy disables it. Emitted live (not persisted to the session event log) on user/host-initiated attempts only, never for silent policy application. Marked experimental while the managed-settings surface stabilizes.
|
|
7911
|
+
*/
|
|
7912
|
+
/** @experimental */
|
|
7913
|
+
export interface ManagedSettingsEnforcedData {
|
|
7914
|
+
action: ManagedSettingsEnforcedAction;
|
|
7915
|
+
escalation?: ManagedSettingsEnforcedEscalation;
|
|
7916
|
+
/**
|
|
7917
|
+
* Whether the enforcement was forced by fail-closed handling (managed policy could not be determined) rather than an explicit managed setting. When true, `setting` still names the restriction that was applied.
|
|
7918
|
+
*/
|
|
7919
|
+
failClosed: boolean;
|
|
7920
|
+
/**
|
|
7921
|
+
* A human-readable explanation of why the action was governed, suitable for surfacing to the user.
|
|
7922
|
+
*/
|
|
7923
|
+
message: string;
|
|
7924
|
+
/**
|
|
7925
|
+
* The managed setting key responsible for the enforcement (e.g. `permissions.disableBypassPermissionsMode`).
|
|
7926
|
+
*/
|
|
7927
|
+
setting: string;
|
|
7928
|
+
}
|
|
7742
7929
|
/**
|
|
7743
7930
|
* Session event "commands.changed". SDK command registration change notification
|
|
7744
7931
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export { CopilotSession, type AssistantMessageEvent } from "./session.js";
|
|
|
10
10
|
export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js";
|
|
11
11
|
export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SYSTEM_MESSAGE_SECTIONS, } from "./types.js";
|
|
12
12
|
export type * from "./generated/session-events.js";
|
|
13
|
-
export type { CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, CapiSessionOptions, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
|
13
|
+
export type { CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, CopilotExpAssignmentResponse, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExpConfigEntry, ExpFlagValue, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, CapiSessionOptions, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -1300,6 +1300,12 @@ export interface CustomAgentConfig {
|
|
|
1300
1300
|
* falling back to the parent session model if unavailable.
|
|
1301
1301
|
*/
|
|
1302
1302
|
model?: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* Reasoning effort level for this agent's model.
|
|
1305
|
+
* When omitted, no per-agent override is sent and the backend chooses its
|
|
1306
|
+
* default. The parent session effort is not inherited.
|
|
1307
|
+
*/
|
|
1308
|
+
reasoningEffort?: ReasoningEffort;
|
|
1303
1309
|
}
|
|
1304
1310
|
/**
|
|
1305
1311
|
* Configuration for the default agent (the built-in agent that handles
|
|
@@ -1492,6 +1498,42 @@ export interface CapiSessionOptions {
|
|
|
1492
1498
|
*/
|
|
1493
1499
|
enableWebSocketResponses?: boolean;
|
|
1494
1500
|
}
|
|
1501
|
+
/**
|
|
1502
|
+
* A single ExP (Experiment Platform) flag value. ExP assignments resolve to a
|
|
1503
|
+
* string, number, boolean, or `null`.
|
|
1504
|
+
*/
|
|
1505
|
+
export type ExpFlagValue = string | number | boolean | null;
|
|
1506
|
+
/**
|
|
1507
|
+
* A single configuration entry in a {@link CopilotExpAssignmentResponse}. Each
|
|
1508
|
+
* entry carries an identifier and a bag of typed parameter values.
|
|
1509
|
+
*/
|
|
1510
|
+
export interface ExpConfigEntry {
|
|
1511
|
+
/** Identifier of the configuration entry. */
|
|
1512
|
+
Id: string;
|
|
1513
|
+
/** Parameter values keyed by parameter name. */
|
|
1514
|
+
Parameters: Record<string, ExpFlagValue>;
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* ExP ("flight") assignment data, in the same JSON shape the Copilot CLI
|
|
1518
|
+
* fetches from the experimentation service. Field names are PascalCase to match
|
|
1519
|
+
* the on-the-wire contract consumed by the runtime.
|
|
1520
|
+
*/
|
|
1521
|
+
export interface CopilotExpAssignmentResponse {
|
|
1522
|
+
/** Enabled feature names. */
|
|
1523
|
+
Features: string[];
|
|
1524
|
+
/** Assigned flights keyed by flight name. */
|
|
1525
|
+
Flights: Record<string, string>;
|
|
1526
|
+
/** Configuration entries carrying typed parameter values. */
|
|
1527
|
+
Configs: ExpConfigEntry[];
|
|
1528
|
+
/** Opaque parameter-group payload passed through untouched. */
|
|
1529
|
+
ParameterGroups?: unknown;
|
|
1530
|
+
/** Version of the flighting configuration. */
|
|
1531
|
+
FlightingVersion?: number;
|
|
1532
|
+
/** Impression identifier for the assignment. */
|
|
1533
|
+
ImpressionId?: string;
|
|
1534
|
+
/** Assignment context string forwarded to CAPI and telemetry. */
|
|
1535
|
+
AssignmentContext: string;
|
|
1536
|
+
}
|
|
1495
1537
|
/**
|
|
1496
1538
|
* Shared configuration fields used by both {@link SessionConfig} (for
|
|
1497
1539
|
* creating a new session) and {@link ResumeSessionConfig} (for resuming
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/github/copilot-sdk.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.8-preview.0",
|
|
8
8
|
"description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC",
|
|
9
9
|
"main": "./dist/cjs/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"author": "GitHub",
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@github/copilot": "^1.0.
|
|
59
|
+
"@github/copilot": "^1.0.72",
|
|
60
60
|
"koffi": "^3.1.0",
|
|
61
61
|
"vscode-jsonrpc": "^8.2.1",
|
|
62
62
|
"zod": "^4.3.6"
|