@azure-tools/typespec-azure-resource-manager 0.69.0 → 0.69.1

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 (50) hide show
  1. package/README.md +40 -0
  2. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts +29 -0
  3. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts.map +1 -0
  4. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.js +2 -0
  5. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.js.map +1 -0
  6. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.d.ts +2 -0
  7. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.d.ts.map +1 -0
  8. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.js +8 -0
  9. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.ts-test.js.map +1 -0
  10. package/dist/generated-defs/Azure.ResourceManager.Private.d.ts +12 -0
  11. package/dist/generated-defs/Azure.ResourceManager.Private.d.ts.map +1 -1
  12. package/dist/src/base-types.d.ts +16 -0
  13. package/dist/src/base-types.d.ts.map +1 -0
  14. package/dist/src/base-types.js +30 -0
  15. package/dist/src/base-types.js.map +1 -0
  16. package/dist/src/index.d.ts +1 -0
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/index.js +1 -0
  19. package/dist/src/index.js.map +1 -1
  20. package/dist/src/lib.d.ts +17 -2
  21. package/dist/src/lib.d.ts.map +1 -1
  22. package/dist/src/lib.js +6 -0
  23. package/dist/src/lib.js.map +1 -1
  24. package/dist/src/linter.d.ts.map +1 -1
  25. package/dist/src/linter.js +4 -0
  26. package/dist/src/linter.js.map +1 -1
  27. package/dist/src/private.decorators.d.ts.map +1 -1
  28. package/dist/src/private.decorators.js +20 -2
  29. package/dist/src/private.decorators.js.map +1 -1
  30. package/dist/src/resource.d.ts +1 -1
  31. package/dist/src/rules/arm-agent-base-type-child-resources.d.ts +4 -0
  32. package/dist/src/rules/arm-agent-base-type-child-resources.d.ts.map +1 -0
  33. package/dist/src/rules/arm-agent-base-type-child-resources.js +94 -0
  34. package/dist/src/rules/arm-agent-base-type-child-resources.js.map +1 -0
  35. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.d.ts +4 -0
  36. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.d.ts.map +1 -0
  37. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.js +99 -0
  38. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.js.map +1 -0
  39. package/dist/src/state.d.ts +1 -0
  40. package/dist/src/state.d.ts.map +1 -1
  41. package/dist/src/state.js +2 -0
  42. package/dist/src/state.js.map +1 -1
  43. package/dist/src/tsp-index.d.ts.map +1 -1
  44. package/dist/src/tsp-index.js +4 -0
  45. package/dist/src/tsp-index.js.map +1 -1
  46. package/lib/arm.tsp +2 -0
  47. package/lib/base-types/agent.tsp +351 -0
  48. package/lib/base-types/base-types.tsp +39 -0
  49. package/lib/private.decorators.tsp +16 -0
  50. package/package.json +6 -6
@@ -0,0 +1,94 @@
1
+ import { createRule, getNamespaceFullName, paramMessage } from "@typespec/compiler";
2
+ import { getParentResource } from "@typespec/rest";
3
+ import { getAzureBaseTypes } from "../base-types.js";
4
+ import { getArmResources } from "../resource.js";
5
+ export const armAgentBaseTypeChildResourcesRule = createRule({
6
+ name: "arm-agent-base-type-child-resources",
7
+ severity: "warning",
8
+ description: "Resources decorated with @azureBaseType for the Agent base type must have both a Conversation and a Response child resource.",
9
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-agent-base-type-child-resources",
10
+ messages: {
11
+ default: paramMessage `Agent resources must have both a Conversation and a Response child resource. Missing: ${"missing"}.`,
12
+ },
13
+ create(context) {
14
+ return {
15
+ root: (program) => {
16
+ const resources = getArmResources(program);
17
+ // Identify agent resources
18
+ const agentResources = resources.filter((r) => hasAgentBaseType(r.typespecType));
19
+ for (const agentResource of agentResources) {
20
+ // Find child resources whose @parentResource points to this agent
21
+ const children = resources.filter((r) => {
22
+ const parent = getParentResource(context.program, r.typespecType);
23
+ return parent === agentResource.typespecType;
24
+ });
25
+ let hasConversation = false;
26
+ let hasResponse = false;
27
+ for (const child of children) {
28
+ const childProps = child.typespecType.properties.get("properties");
29
+ if (childProps?.type.kind === "Model") {
30
+ if (isConversationProperties(childProps.type)) {
31
+ hasConversation = true;
32
+ }
33
+ if (isResponseProperties(childProps.type)) {
34
+ hasResponse = true;
35
+ }
36
+ }
37
+ }
38
+ const missing = [];
39
+ if (!hasConversation)
40
+ missing.push("Conversation");
41
+ if (!hasResponse)
42
+ missing.push("Response");
43
+ if (missing.length > 0) {
44
+ context.reportDiagnostic({
45
+ format: { missing: missing.join(", ") },
46
+ target: agentResource.typespecType,
47
+ });
48
+ }
49
+ }
50
+ },
51
+ };
52
+ function hasAgentBaseType(model) {
53
+ const directTypes = getAzureBaseTypes(context.program, model);
54
+ if (directTypes && isAgent(directTypes))
55
+ return true;
56
+ if (model.sourceModels) {
57
+ for (const source of model.sourceModels) {
58
+ const sourceTypes = getAzureBaseTypes(context.program, source.model);
59
+ if (sourceTypes && isAgent(sourceTypes))
60
+ return true;
61
+ }
62
+ }
63
+ return false;
64
+ }
65
+ function isAgent(types) {
66
+ return types.some((bt) => bt.baseType === "Agent");
67
+ }
68
+ function isConversationProperties(model) {
69
+ return checkModelName(model, "ConversationProperties");
70
+ }
71
+ function isResponseProperties(model) {
72
+ return checkModelName(model, "ResponseProperties");
73
+ }
74
+ function checkModelName(model, name) {
75
+ if (model.name === name) {
76
+ const ns = model.namespace ? getNamespaceFullName(model.namespace) : "";
77
+ if (ns === "Azure.ResourceManager.BaseTypes.Agents")
78
+ return true;
79
+ }
80
+ if (model.baseModel) {
81
+ if (checkModelName(model.baseModel, name))
82
+ return true;
83
+ }
84
+ if (model.sourceModels) {
85
+ for (const source of model.sourceModels) {
86
+ if (checkModelName(source.model, name))
87
+ return true;
88
+ }
89
+ }
90
+ return false;
91
+ }
92
+ },
93
+ });
94
+ //# sourceMappingURL=arm-agent-base-type-child-resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arm-agent-base-type-child-resources.js","sourceRoot":"","sources":["../../../src/rules/arm-agent-base-type-child-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAqB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAAC;IAC3D,IAAI,EAAE,qCAAqC;IAC3C,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,8HAA8H;IAChI,GAAG,EAAE,wHAAwH;IAC7H,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,yFAAyF,SAAS,GAAG;KAC3H;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;gBACzB,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;gBAE3C,2BAA2B;gBAC3B,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;gBAEjF,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;oBAC3C,kEAAkE;oBAClE,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;wBACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;wBAClE,OAAO,MAAM,KAAK,aAAa,CAAC,YAAY,CAAC;oBAC/C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AAI,CAAC;wBAAE,OAAO,IAAI,CAAC;gBACtD,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const armAgentBaseTypeLifecycleOperationsRule: import("@typespec/compiler").LinterRuleDefinition<"arm-agent-base-type-lifecycle-operations", {
2
+ readonly default: import("@typespec/compiler").CallableMessage<["resourceName", "missing"]>;
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=arm-agent-base-type-lifecycle-operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arm-agent-base-type-lifecycle-operations.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-agent-base-type-lifecycle-operations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uCAAuC;;yBAiGlD,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { createRule, getNamespaceFullName, paramMessage } from "@typespec/compiler";
2
+ import { getParentResource } from "@typespec/rest";
3
+ import { getAzureBaseTypes } from "../base-types.js";
4
+ import { getArmResources } from "../resource.js";
5
+ export const armAgentBaseTypeLifecycleOperationsRule = createRule({
6
+ name: "arm-agent-base-type-lifecycle-operations",
7
+ severity: "warning",
8
+ description: "Conversation and Response child resources of an Agent must define create, read, update, and delete lifecycle operations.",
9
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-agent-base-type-lifecycle-operations",
10
+ messages: {
11
+ default: paramMessage `Resource "${"resourceName"}" is missing required lifecycle operations: ${"missing"}.`,
12
+ },
13
+ create(context) {
14
+ return {
15
+ root: (program) => {
16
+ const resources = getArmResources(program);
17
+ // Identify agent resources
18
+ const agentResources = resources.filter((r) => hasAgentBaseType(r.typespecType));
19
+ for (const agentResource of agentResources) {
20
+ // Find child resources whose @parentResource points to this agent
21
+ const children = resources.filter((r) => {
22
+ const parent = getParentResource(context.program, r.typespecType);
23
+ return parent === agentResource.typespecType;
24
+ });
25
+ for (const child of children) {
26
+ const childProps = child.typespecType.properties.get("properties");
27
+ if (childProps?.type.kind !== "Model")
28
+ continue;
29
+ const isConversation = isConversationProperties(childProps.type);
30
+ const isResponse = isResponseProperties(childProps.type);
31
+ if (!isConversation && !isResponse)
32
+ continue;
33
+ // Check lifecycle operations
34
+ const lifecycle = child.operations.lifecycle;
35
+ const missing = [];
36
+ if (!lifecycle.createOrUpdate)
37
+ missing.push("create");
38
+ if (!lifecycle.read)
39
+ missing.push("read");
40
+ if (!lifecycle.update)
41
+ missing.push("update");
42
+ if (!lifecycle.delete)
43
+ missing.push("delete");
44
+ if (missing.length > 0) {
45
+ context.reportDiagnostic({
46
+ format: {
47
+ resourceName: child.typespecType.name,
48
+ missing: missing.join(", "),
49
+ },
50
+ target: child.typespecType,
51
+ });
52
+ }
53
+ }
54
+ }
55
+ },
56
+ };
57
+ function hasAgentBaseType(model) {
58
+ const directTypes = getAzureBaseTypes(context.program, model);
59
+ if (directTypes && isAgent(directTypes))
60
+ return true;
61
+ if (model.sourceModels) {
62
+ for (const source of model.sourceModels) {
63
+ const sourceTypes = getAzureBaseTypes(context.program, source.model);
64
+ if (sourceTypes && isAgent(sourceTypes))
65
+ return true;
66
+ }
67
+ }
68
+ return false;
69
+ }
70
+ function isAgent(types) {
71
+ return types.some((bt) => bt.baseType === "Agent");
72
+ }
73
+ function isConversationProperties(model) {
74
+ return checkModelName(model, "ConversationProperties");
75
+ }
76
+ function isResponseProperties(model) {
77
+ return checkModelName(model, "ResponseProperties");
78
+ }
79
+ function checkModelName(model, name) {
80
+ if (model.name === name) {
81
+ const ns = model.namespace ? getNamespaceFullName(model.namespace) : "";
82
+ if (ns === "Azure.ResourceManager.BaseTypes.Agents")
83
+ return true;
84
+ }
85
+ if (model.baseModel) {
86
+ if (checkModelName(model.baseModel, name))
87
+ return true;
88
+ }
89
+ if (model.sourceModels) {
90
+ for (const source of model.sourceModels) {
91
+ if (checkModelName(source.model, name))
92
+ return true;
93
+ }
94
+ }
95
+ return false;
96
+ }
97
+ },
98
+ });
99
+ //# sourceMappingURL=arm-agent-base-type-lifecycle-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arm-agent-base-type-lifecycle-operations.js","sourceRoot":"","sources":["../../../src/rules/arm-agent-base-type-lifecycle-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAqB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,uCAAuC,GAAG,UAAU,CAAC;IAChE,IAAI,EAAE,0CAA0C;IAChD,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,0HAA0H;IAC5H,GAAG,EAAE,6HAA6H;IAClI,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,aAAa,cAAc,+CAA+C,SAAS,GAAG;KAC5G;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;gBACzB,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;gBAE3C,2BAA2B;gBAC3B,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;gBAEjF,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;oBAC3C,kEAAkE;oBAClE,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;wBACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;wBAClE,OAAO,MAAM,KAAK,aAAa,CAAC,YAAY,CAAC;o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AAc,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC;oBAAE,OAAO,IAAI,CAAC;YACzD,CAAC;YACD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACvB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;oBACxC,IAAI,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;wBAAE,OAAO,IAAI,CAAC;gBACtD,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -30,5 +30,6 @@ export declare const ArmStateKeys: {
30
30
  armExternalType: symbol;
31
31
  inlineAzureType: symbol;
32
32
  genericResource: symbol;
33
+ azureBaseTypes: symbol;
33
34
  };
34
35
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCxB,CAAC"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCxB,CAAC"}
package/dist/src/state.js CHANGED
@@ -39,5 +39,7 @@ export const ArmStateKeys = {
39
39
  armExternalType: azureResourceManagerCreateStateSymbol("armExternalType"),
40
40
  inlineAzureType: azureResourceManagerCreateStateSymbol("inlineAzureType"),
41
41
  genericResource: azureResourceManagerCreateStateSymbol("genericResource"),
42
+ // base-types.ts
43
+ azureBaseTypes: azureResourceManagerCreateStateSymbol("azureBaseTypes"),
42
44
  };
43
45
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,2DAA2D;A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ings":"AAmCA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { $azureBaseType } from "./base-types.js";
1
2
  import { $armCommonTypesVersion, $externalTypeRef } from "./common-types.js";
2
3
  import { $armLibraryNamespace, $armProviderNamespace, $useLibraryNamespace } from "./namespace.js";
3
4
  import { $armOperationRoute, $armResourceAction, $armResourceCheckExistence, $armResourceCollectionAction, $armResourceCreateOrUpdate, $armResourceDelete, $armResourceList, $armResourceRead, $armResourceUpdate, $renamePathParameter, } from "./operations.js";
@@ -30,6 +31,9 @@ export const $decorators = {
30
31
  resourceBaseType: $resourceBaseType,
31
32
  identifiers: $identifiers,
32
33
  },
34
+ "Azure.ResourceManager.BaseTypes": {
35
+ azureBaseType: $azureBaseType,
36
+ },
33
37
  "Azure.ResourceManager.Legacy": {
34
38
  customAzureResource: $customAzureResource,
35
39
  externalTypeRef: $externalTypeRef,
@@ -1 +1 @@
1
- {"version":3,"file":"tsp-index.js","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,QA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rC,eAAe,EAAE,gBAAgB;QACjC,yBAAyB,EAAE,0BAA0B;QACrD,qBAAqB,EAAE,sBAAsB;QAC7C,qBAAqB,EAAE,sBAAsB;QAC7C,kBAAkB,EAAE,mBAAmB;QACvC,gBAAgB,EAAE,iBAAiB;QACnC,WAAW,EAAE,YAAY;KACe;IAC1C,iCAAiC,EAAE;QACjC,aAAa,EAAE,cAAc;KACoB;IACnD,8BAA8B,EAAE;QAC9B,mBAAmB,EAAE,oBAAoB;QACzC,eAAe,EAAE,gBAAgB;QACjC,iBAAiB,EAAE,kBAAkB;QACrC,eAAe,EAAE,gBAAgB;QACjC,mBAAmB,EAAE,oBAAoB;QACzC,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,SAAS;QACnB,cAAc,EAAE,eAAe;KACe;CACjD,CAAC"}
package/lib/arm.tsp CHANGED
@@ -12,6 +12,8 @@ import "./legacy-types/arm.legacy.tsp";
12
12
  import "./common-types/common-types.tsp";
13
13
  import "./extension/extension.tsp";
14
14
  import "./backcompat.tsp";
15
+ import "./base-types/base-types.tsp";
16
+ import "./base-types/agent.tsp";
15
17
  import "./private.decorators.tsp";
16
18
  import "./models.tsp";
17
19
  import "./operations.tsp";
@@ -0,0 +1,351 @@
1
+ import "./base-types.tsp";
2
+
3
+ using Azure.ResourceManager;
4
+ using Azure.ResourceManager.BaseTypes;
5
+ using Azure.ResourceManager.Private;
6
+ using TypeSpec.Rest;
7
+
8
+ namespace Azure.ResourceManager.BaseTypes.Agents;
9
+
10
+ // ============================================================================
11
+ // Agent Tool Types
12
+ // ============================================================================
13
+
14
+ /**
15
+ * A tool binding for an agent (Appliance deployment model).
16
+ * All properties are read-only (the appliance owns and reports state).
17
+ */
18
+ model AgentToolTypeAppliance {
19
+ /** Tool type discriminator. Must be one of the publicly documented Azure AI Foundry tool types. */
20
+ @visibility(Lifecycle.Read)
21
+ type: string;
22
+
23
+ /** Tool name/identifier. */
24
+ @visibility(Lifecycle.Read)
25
+ name: string;
26
+ }
27
+
28
+ /**
29
+ * A tool binding for an agent (Platform deployment model).
30
+ * All properties have default visibility (the client owns these fields).
31
+ */
32
+ model AgentToolTypePlatform {
33
+ /** Tool type discriminator. Must be one of the publicly documented Azure AI Foundry tool types. */
34
+ type: string;
35
+
36
+ /** Tool name/identifier. */
37
+ name: string;
38
+ }
39
+
40
+ // ============================================================================
41
+ // Agent Definition
42
+ // ============================================================================
43
+
44
+ /**
45
+ * Inline agent definition describing the model and behavior of the agent.
46
+ * This model is used only as a constraint for template parameters.
47
+ */
48
+ internal model AgentDefinition {
49
+ /** Model identifier (RP-defined). */
50
+ `model`: string;
51
+
52
+ /** System prompt / behavioral instructions for the agent. */
53
+ instructions: string;
54
+ }
55
+
56
+ /**
57
+ * Appliance deployment model of AgentDefinition.
58
+ * Properties controlled by `@baseTypeOptional` are invisible when the corresponding
59
+ * template parameter is false, or read-only when present.
60
+ * @template HasModelDeploymentRef Whether the modelDeploymentRef property is present.
61
+ * @template HasInstructions Whether the instructions property is present.
62
+ */
63
+ model AgentDefinitionAppliance<
64
+ HasModelDeploymentRef extends valueof boolean = false,
65
+ HasInstructions extends valueof boolean = false
66
+ > {
67
+ /** Model identifier (RP-defined). */
68
+ @visibility(Lifecycle.Read)
69
+ `model`: string;
70
+
71
+ /** System prompt / behavioral instructions for the agent. */
72
+ @baseTypeOptional(HasInstructions, true)
73
+ instructions: string;
74
+
75
+ /** Optional RP-specific reference to an underlying model deployment. */
76
+ @baseTypeOptional(HasModelDeploymentRef, true)
77
+ modelDeploymentRef?: string;
78
+ }
79
+
80
+ /**
81
+ * Platform deployment model of AgentDefinition.
82
+ * Properties controlled by `@baseTypeOptional` are invisible when the corresponding
83
+ * template parameter is false, or have default visibility when present.
84
+ * @template HasModelDeploymentRef Whether the modelDeploymentRef property is present.
85
+ * @template HasInstructions Whether the instructions property is present.
86
+ */
87
+ model AgentDefinitionPlatform<
88
+ HasModelDeploymentRef extends valueof boolean = false,
89
+ HasInstructions extends valueof boolean = false
90
+ > {
91
+ /** Model identifier (RP-defined). */
92
+ `model`: string;
93
+
94
+ /** System prompt / behavioral instructions for the agent. */
95
+ @baseTypeOptional(HasInstructions, false)
96
+ instructions: string;
97
+
98
+ /** Optional RP-specific reference to an underlying model deployment. */
99
+ @baseTypeOptional(HasModelDeploymentRef, false)
100
+ modelDeploymentRef?: string;
101
+ }
102
+
103
+ // ============================================================================
104
+ // Agent Properties (resource property bag)
105
+ // ============================================================================
106
+
107
+ /**
108
+ * Required properties for an agent resource.
109
+ * This model is used only as a constraint for template parameters.
110
+ */
111
+ internal model AgentProperties {
112
+ /** ARM-managed. Must include the base type descriptor for this resource. */
113
+ @visibility(Lifecycle.Read)
114
+ baseTypes: BaseTypeInfo[];
115
+
116
+ /** Human-friendly name. */
117
+ displayName: string;
118
+
119
+ /** Purpose/behavior summary. */
120
+ description: string;
121
+
122
+ /** Inline agent definition (must extend AgentDefinition). */
123
+ definition: AgentDefinition;
124
+ }
125
+
126
+ /**
127
+ * Appliance deployment model of AgentProperties.
128
+ * All properties are read-only (the appliance owns and reports state).
129
+ * @template AgentDefinitionType The user-defined agent definition model (must extend AgentDefinition).
130
+ */
131
+ model AgentPropertiesAppliance<AgentDefinitionType extends AgentDefinition> {
132
+ /** ARM-managed. Must include the base type descriptor for this resource. */
133
+ @visibility(Lifecycle.Read)
134
+ baseTypes: BaseTypeInfo[];
135
+
136
+ /** Human-friendly name. */
137
+ @visibility(Lifecycle.Read)
138
+ displayName: string;
139
+
140
+ /** Purpose/behavior summary. */
141
+ @visibility(Lifecycle.Read)
142
+ description: string;
143
+
144
+ /** Inline agent definition. */
145
+ @visibility(Lifecycle.Read)
146
+ definition: AgentDefinitionType;
147
+
148
+ /** Tool bindings. Read-only in the Appliance deployment model. */
149
+ @visibility(Lifecycle.Read)
150
+ tools?: AgentToolTypeAppliance[];
151
+ }
152
+
153
+ /**
154
+ * Platform deployment model of AgentProperties.
155
+ * Properties have default visibility (the client owns these fields).
156
+ * baseTypes remains ARM-managed and read-only.
157
+ * @template AgentDefinitionType The user-defined agent definition model (must extend AgentDefinition).
158
+ */
159
+ model AgentPropertiesPlatform<AgentDefinitionType extends AgentDefinition> {
160
+ /** ARM-managed. Must include the base type descriptor for this resource. */
161
+ @visibility(Lifecycle.Read)
162
+ baseTypes: BaseTypeInfo[];
163
+
164
+ /** Human-friendly name. */
165
+ displayName: string;
166
+
167
+ /** Purpose/behavior summary. */
168
+ description: string;
169
+
170
+ /** Inline agent definition. */
171
+ definition: AgentDefinitionType;
172
+
173
+ /** Tool bindings. Writable in the Platform deployment model. */
174
+ tools?: AgentToolTypePlatform[];
175
+ }
176
+
177
+ // ============================================================================
178
+ // Conversation Types
179
+ // ============================================================================
180
+
181
+ /**
182
+ * Properties for a conversation resource holding the items and metadata
183
+ * exchanged between a client and an agent.
184
+ */
185
+ model ConversationProperties {
186
+ /** Unique conversation identifier. Read-only (set by the service on creation). */
187
+ @visibility(Lifecycle.Read)
188
+ conversationId?: string;
189
+
190
+ /** Timestamp of when the conversation was created. Read-only. */
191
+ @visibility(Lifecycle.Read)
192
+ createdAt?: unixTimestamp32;
193
+ }
194
+
195
+ /**
196
+ * A single input message provided to the model.
197
+ */
198
+ model InputMessage {
199
+ /** The role of the message author (for example, user, system, or developer). */
200
+ role: string;
201
+
202
+ /** The content of the input message. */
203
+ content: string;
204
+ }
205
+
206
+ /** Mix-in for input type discriminator. */
207
+ model InputTypeProperty {
208
+ /** The input type discriminator. */
209
+ type?: string = "message";
210
+ }
211
+
212
+ /** Output from a conversation. */
213
+ model ConversationOutput {
214
+ /** The output identifier. */
215
+ id: string;
216
+ }
217
+
218
+ // ============================================================================
219
+ // Response Types
220
+ // ============================================================================
221
+
222
+ /**
223
+ * The status of a response.
224
+ */
225
+ @Azure.Core.lroStatus
226
+ union ResponseStatus {
227
+ /** The response completed successfully. */
228
+ @Azure.Core.lroSucceeded
229
+ Completed: "completed",
230
+
231
+ /** The response failed. */
232
+ @Azure.Core.lroFailed
233
+ Failed: "failed",
234
+
235
+ /** The response was cancelled. */
236
+ @Azure.Core.lroCanceled
237
+ Cancelled: "cancelled",
238
+
239
+ /** The response is incomplete. */
240
+ Incomplete: "incomplete",
241
+
242
+ /** The response is queued for execution. */
243
+ Queued: "queued",
244
+
245
+ /** The response is in progress. */
246
+ InProgress: "in_progress",
247
+
248
+ string,
249
+ }
250
+
251
+ /**
252
+ * Properties for a response generated by an agent for a given input,
253
+ * including its output, status, and usage.
254
+ */
255
+ model ResponseProperties {
256
+ /** Unique response identifier. Read-only (set by the service). */
257
+ @visibility(Lifecycle.Read)
258
+ responseId?: string;
259
+
260
+ /** Timestamp of when the response was created. Read-only. */
261
+ @visibility(Lifecycle.Read)
262
+ createdAt?: unixTimestamp32;
263
+
264
+ /** Model ID used to generate the response. May be specified on request to override the agent default; read-only in GET. */
265
+ `model`?: string;
266
+
267
+ /** The status of the response. Read-only. */
268
+ @visibility(Lifecycle.Read)
269
+ status?: ResponseStatus;
270
+
271
+ /** Content input to the model. Required on create. */
272
+ input: InputMessage;
273
+ }
274
+
275
+ /**
276
+ * An item produced in the response output, such as a message or tool call.
277
+ */
278
+ model ResponseOutputItem {
279
+ /** Unique identifier of the output item. */
280
+ @visibility(Lifecycle.Read)
281
+ id?: string;
282
+
283
+ /** The output item type (for example, message or tool call). */
284
+ @visibility(Lifecycle.Read)
285
+ type?: string;
286
+
287
+ /** The role associated with the output item. */
288
+ @visibility(Lifecycle.Read)
289
+ role?: string;
290
+
291
+ /** The status of the output item. */
292
+ @visibility(Lifecycle.Read)
293
+ status?: ResponseStatus;
294
+
295
+ /** The content of the output item. */
296
+ @visibility(Lifecycle.Read)
297
+ content?: string;
298
+ }
299
+
300
+ /** Mix-in for the output property. */
301
+ model ResponseOutputProperty {
302
+ /** Output items (messages, tool calls, etc.). Read-only. */
303
+ @visibility(Lifecycle.Read)
304
+ output: ResponseOutputItem[];
305
+ }
306
+
307
+ /** Mix-in for the previousResponseId property. */
308
+ model PreviousResponseProperty {
309
+ /** ID of a previous response for multi-turn chaining. Writable on create. */
310
+ previousResponseId?: string;
311
+ }
312
+
313
+ /** Mix-in for response instructions. */
314
+ model ResponseInstructionsProperty {
315
+ /** System/developer message for this response. Writable on create; overrides agent-level instructions for this invocation. */
316
+ instructions?: string;
317
+ }
318
+
319
+ // ============================================================================
320
+ // Resource Templates
321
+ // ============================================================================
322
+
323
+ /**
324
+ * Model template for an Agent tracked resource.
325
+ * Applies the Agent base type decorator automatically.
326
+ * @template Properties RP-specific properties for the agent (must extend AgentProperties)
327
+ */
328
+ @azureBaseType(#{ baseType: "Agent", version: "2024-06-01" })
329
+ model Agent<Properties extends AgentProperties> is TrackedResource<Properties>;
330
+
331
+ /**
332
+ * Model template for a Conversation child resource of an Agent.
333
+ * @template Properties RP-specific properties for the conversation (must extend ConversationProperties)
334
+ * @template AgentResource The parent Agent resource type
335
+ */
336
+ @parentResource(AgentResource)
337
+ model AgentConversation<
338
+ Properties extends ConversationProperties,
339
+ AgentResource extends Foundations.Resource
340
+ > is ProxyResource<Properties>;
341
+
342
+ /**
343
+ * Model template for a Response child resource of an Agent.
344
+ * @template Properties RP-specific properties for the response (must extend ResponseProperties)
345
+ * @template AgentResource The parent Agent resource type
346
+ */
347
+ @parentResource(AgentResource)
348
+ model AgentResponse<
349
+ Properties extends ResponseProperties,
350
+ AgentResource extends Foundations.Resource
351
+ > is ProxyResource<Properties>;